[11:10] <Doow> Hi, I'm trying to figure out why my apache daemon doesn't start. I'm running on ubuntu 17.04. It times out when trying to start and I get no output other than that in syslog, journalctl, access.log or error.log. I removed all symlinks in sites-enabled, but no improvement.
[11:11] <ikonia> what does a config file check say
[11:11] <ikonia> you should get something in the error log
[11:11] <ikonia> and you should get something from journalctl
[11:13] <Doow> ikonia: how do I do a config file check? (I assume you're talking about something automatic)
[11:13] <maxb> apachectl configtest
[11:14] <ikonia> there you go, as max said
[11:15] <Doow> AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[11:15] <Doow> Syntax OK
[11:17] <Doow> I'm waiting for it to timeout so I can paste you the log for journalctl
[11:17] <ikonia> so there is something you should fix to make life easier
[11:17] <ikonia> it's got no FQDN so it's defaulting to the loopback address
[11:18] <ikonia> thats going to make it pretty worthless unless you access it on localhost
[11:18] <Doow> ikonia: I have that set up in two different virtualhosts that I disabled while trying to figure this out.
[11:19] <ikonia> it's pointless then
[11:19] <ikonia> becuase you're trying to figure out something that is broken
[11:19] <ikonia> but something you're not going to use
[11:19] <ikonia> test it properly
[11:19] <ikonia> and even if you add two other virtualhosts, that base config will still be there
[11:19] <ikonia> ServerName still needs to be set outside the virtualhosts
[11:19] <maxb> Well.... you can get by with a wrong ServerName if the server isn't generating self-referential URLs a lot of the time. Not that you *should*, of course. But it's a relatively minor wart compared to the server not starting up cleanly
[11:20] <ikonia> it's noise that's not needed
[11:20] <maxb> That's true
[11:20] <Doow> what would you recommend I set it to? in general terms of course. It won't be listening for anything on that adress, or should I reuse one of the virtualhosts domain name?
[11:21] <maxb> If you're certain all your traffic is going to hit a <VirtualHost> and nothing is going to be processed by the default server, you can quite happily get by with "ServerName default.server.unused" or any other designator for the admin's eyes only
[11:21] <Doow> maxb: ok, I'll use that =)
[11:22] <ikonia> it needs to be resolvable though
[11:22] <Doow> google.com?
[11:22] <maxb> Eww
[11:22] <ikonia> even if it's just resolvable by the hostfile
[11:22] <ikonia> don't be silly
[11:22] <ikonia> you're going to tell your server to listen on a google.com IP ?
[11:23] <Doow> ikonia: something that's just resolvable locally sounds fine
[11:23] <maxb> It needs to be resolvable? I have production stuff quite happily using a name non-existent in DNS or hosts to represent the unused base server
[11:23] <ikonia> maxb: if it's not resolvable it drops back to localhost
[11:24] <ikonia> x-ref the warning you see
[11:24] <maxb> 'drops back to' ?
[11:24] <ikonia> Could not reliably determine the server's fully qualified domain name using 127.0.1.1
[11:24] <ikonia> it can't resolve the servers FQDN - so it drops back to using the localhost IP
[11:24] <maxb> using the IP for what?
[11:25] <ikonia> ServerName value
[11:26] <ikonia> Doow: has it timed out yet ?
[11:26] <Doow> ikonia: yeah, got occupied by the ServerName ;)
[11:29] <Doow> https://paste.ubuntu.com/24573808/
[11:29] <Doow> that's from journalctl -xe
[11:30] <ikonia> PWD=/home/user/apache/mods-enabled
[11:30] <ikonia> ??
[11:31] <ikonia> what's that about
[11:31] <Doow> ikonia: just a backup folder I was standing in when doing sudo systemctl start apache2.service
[11:31] <ikonia> Doow: pastebin the apache error.log
[11:32] <Doow> ikonia: it's 0 bytes long
[11:32] <ikonia> ok - so it's not even trying to start
[11:32] <ikonia> is this a clean/standard 17.04 install
[11:32] <ikonia> or have you done anything with it / got external software etc
[11:33] <Doow> no, it's an upgrade from 16.10
[11:33] <Doow> and I added some mods, I'm running owncloud and a custom django site
[11:34] <ikonia> pastebin the output of systemctl status apache2.service
[11:34] <Doow> as well as set up https for those two sites
[11:36] <Doow> https://paste.ubuntu.com/24573830/
[11:38] <ikonia> do a manual start
[11:38] <ikonia> httpd -f /where/your/config/file/is
[11:40] <maxb> That won't work, rather, try 'APACHE_STARTED_BY_SYSTEMD=1 apachectl -e debug'
[11:41] <maxb> Ubuntu renames the httpd binary to apache2, and supplies a configuration file which requires various environment variables set via apachectl to complete the configuration
[11:41] <ikonia> you should still be able to do apache2 -f to get a base start up
[11:41] <ikonia> and hopefully a bit of noise on problems
[11:41] <ikonia> maxb: interesting that you can set APACHE_STARTED_BY_SYSTEMD
[11:42] <ikonia> didn't know that
[11:42] <maxb> 'apache2 -f /etc/apache2/apache2.conf' will just give you a complaint about 'Invalid Mutex directory in argument file:${APACHE_LOCK_DIR}' or similar
[11:43] <maxb> (Unless of course you rewrite the Ubuntu default config file to avoid the use of environment interpolations - then your method would be OK)
[11:43] <ikonia> maxb: thats intersting, I'd have not expected that
[11:44] <maxb> The Ubuntu default config is a bit too complicated for the average user's needs, in my opinion
[11:44] <ikonia> I'd not considered that, but yes, if t's going to depend on "system" variables to actually run over config file based variables, that would add confusion
[11:45] <Doow> yeah, it complains about a number of settings that are in /etc/apache2/envvars (as you said maxb). Then it also have some problems with permissions, should I run this as www-data? or root? (everything in /etc/apache2 is owned by root:root)
[11:45] <maxb> You should be doing this as root
[11:46] <maxb> I'm sure the few people who want to run multiple isolated httpd processes with different configs on the same server are very thankful for all the hooks that Ubuntu provides to make that easy - but they can confuse the situation for majority who don't want that.
[11:46] <ikonia> maxb: which to be fair will be a minority
[11:47] <Doow> APACHE_STARTED_BY_SYSTEMD=1 apachectl -e debug: command not found
[11:47] <maxb> The quotes I included were only for the benefit of showing the command in context in IRC - they weren't intended to be literally entered at the shell
[11:47] <Doow> I assume it should set, or export or something before that? (my bash scripting is not up to par unfortunately
[11:48] <Doow> maxb: ok, now it starts without complaining, let me check some logs =)
[11:55] <Doow> maxb, ikonia: I tried enabling everything again, both sites, etc, and it seems to be working as long as I launch with -debug and APACHE_STARTED_BY_SYSTEMD=1 as per above
[11:56] <maxb> First, swap the -e debug for -k start
[11:57] <maxb> That changes the invocation of Apache to be as close as possible to what the default startup procedure is doing
[11:58] <maxb> I'm guessing that's not going to change anything, at which point the problem has been localised to the interaction between systemd and apache, nothing to do with apache itself
[11:59] <maxb> At which point, pastebin the output of the following so that we can see whether you have any local overrides in your systemd config for apache:
[11:59] <maxb> # find /etc/systemd -name '*apache*' -ls
[12:01] <Doow> Yeah, that works as well, brb with pastebin
[12:02] <maxb> Also, does 'debsums --changed apache2' give any output? (I want to see if any of the apache-related files in /lib/systemd/system have been improperly modified)
[12:03] <Doow> https://paste.ubuntu.com/24573950/
[12:04] <maxb> I think we just found the culprit. /etc/systemd/system/apache2.service is a file locally defined on your system which is probably messing things up
[12:04] <Doow> nope, no output from debsums, I'm keeping that though, very convenient
[12:04] <maxb> Please pastebin the contents
[12:04] <Doow> sure
[12:06] <maxb> Additionally you seem to be missing an expected symlink, so you should run 'systemctl enable apache2' if you want it to automatically start after a reboot
[12:06] <Doow> https://paste.ubuntu.com/24573963/
[12:07] <Doow> maxb: how do you know what the expected config looks like? do you have clean machine set up, or is there some reference?
[12:07] <maxb> I'm just looking at my desktop, which I know I haven't changed in this respect
[12:07] <Doow> maxb: could be useful to solve my own problems in the future
[12:07] <Doow> maxb: aha, that makes sense
[12:08] <maxb> So, I don't know how /etc/systemd/system/apache2.service got there, but it's wrong and shadowing the correct version provided by the package in /lib/systemd/system/apache2.service
[12:09] <ikonia> I suspect it may have come from one of the modules that was manually/externally installed
[12:09] <maxb> You should delete or move away /etc/systemd/system/apache2.service - and then I don't remember whether systemd just notices automatically, or you have to run 'systemctl daemon-reload'
[12:10] <Doow> maxb: It's probably a remnant of when I tried to get apache to start on boot, I wouldn't mind removing it
[12:10] <Doow> I'll give it a try
[12:10] <maxb> After which, pastebin the output of 'systemctl status apache2' so we can see what your systemd thinks the new status is
[12:16] <Doow> maxb: looks fine from what I can see: https://paste.ubuntu.com/24573997/
[12:17] <maxb> Mostly fine - but it does still say 'disabled' meaning it won't start at boot.
[12:17] <maxb> Quite possibly because I suggested you ran enable before deleting the service file
[12:18] <Doow> maxb: I hadn't ran enable yet at that point, it says enabled now
[12:18] <maxb> all sorted then
[12:18] <maxb> The lesson is to be wary of local customizations interfering with the operation of system packages :-)
[12:19] <Doow> maxb: I'll try rebooting as well to see that everything is fine, but from what I can see everything is looking great :)
[12:20] <Doow> maxb: yeah, I like systemd, but I still don't know how everything is working. thanks for all the help (you too ikonia)
[12:22] <ikonia> you fixed it yourself, well done
[12:24] <Doow> rebooting worked great as well, everything started without problems =D
[12:25] <ikonia> well done
[15:50] <teward> this'll sound like an insane question, but is there any way to get a desktop environment inside an LXD container, so that i could, say, VNC to it or X-Forward to it and then have it VPN outbound without affecting my host system?
[15:50] <teward> I have it in a VM right now, but... just curious if I can do it with an LXD container.
[17:22] <ArchaicLord> HI just instlaling 16.04 onto a usb drive from a cd. and got
[17:22] <ArchaicLord> Exiting on error base-installer/kernel/failed-install
[17:22] <ArchaicLord> What is this and how do I fix it?
[17:30] <teward> ArchaicLord: did you verify the integrity of the LiveCD image before you burned it, by chekcing the hash sums against known good ones?
[17:31] <teward> (to make sure your image was complete)
[17:31] <ArchaicLord> No i didn't
[17:32] <ArchaicLord> I downloaded the default lts from Ubuntu website
[17:40] <ArchaicLord> not sure how I managed to get this but I have been given a list of kernals
[17:40] <ArchaicLord> I guess I shouldn't use linux-generic as that just failed
[17:40] <ArchaicLord> any suggestions which one to use instead
[18:49] <ArchaicLord> ok so i checeked the md5 and it was fine there was a match.. i also re downloaded and burned again and still same issue. luckly i found an older server install disk and this is working fine so not sure why the current download won't work
[19:26] <teward> i've got a question here, I've got multiple LXD containers, and multiple public IPs on this one box.  I'd like to route the public IP data to one of the LXD containers specifically, anyone know how I can do that for just the one LXD container?