Recently apache2 fails to start at boot, but can be started OK manually
Karl Auer
kauer at biplane.com.au
Tue Oct 26 21:24:47 UTC 2021
On Tue, 2021-10-26 at 18:57 +0100, Chris Green wrote:
> On Wed, Oct 27, 2021 at 01:06:08AM +1100, Karl Auer wrote:
> > On Tue, 2021-10-26 at 13:59 +0100, Chris Green wrote:
> > > make_sock: could not bind to address
> >
> > This almost always means something else is already listening
> >
> Unlkely, the error in that case is usually "address already in use"
> and that's not what we're seeing.
Google "make_sock: could not bind to address" and reconsider.
> > You can confirm this by configuring Apache2 to use a different
> > port, like 81, and see if it then starts properly on boot.
> >
> I might try that if nothing else obvious pops up.
It takes five minutes and a reboot. Why not try it now and eliminate a
possibility?
> But apache can't even open the log files so it can't report why it
> couldn't start. I've not changed anything on my system, all I have
> done is 'apt update' and 'apt upgrade'.
Not the Apache logs - other logs. You are looking for something that
started before Apache2 and then stopped, probably with a configuration
error, and that might have temporarily held port 80 on that address
Also "I haven't changed my system" and "all I have done is 'apt update'
and 'apt upgrade'" is oxymoronic. Looking at the upgrade history might
also offer a clue.
> > Can you start later Apache2 using "systemctl start apache2"
> >
> I'll try that but I suspect that the /etc/init.d/apache2 just links
> to the standard systemd startup, the messages it preoduces seem that
> way.
I think so too - but the error messages you see talk about
apache2.service, and you are not using systemctl when you start it
later. Just to make sure, try starting it the exact same way as the
boot process does.
> > Is it possible that the address 192.168.1.3 does not exist at the
> > time Apache2 first starts?
> >
> It's set up as a static address and is the system's only address so
> it would seem to be unlikely, though the symptoms suggest maybe it
> isn't there when apache tries to start. That's why I surmised that
> apache was trying to start up too early in the boot sequence.
Issues with the network are something else to look for in the logs.
The obvious has been checked - so whatever the cause of this is, it's
probably "unlikely". I wouldn't shy away from checking unlikely things
at this point.
That message is completely unambiguous: Apache2 could not bind to that
port on that address". The possible causes are many, but the possible
reasons are few: The address does not exist, the port is already taken,
the process does not have permission to bind. That last is looking
increasingly likely to me. Trying a high-numbered port like 8080 would
offer a clue in that direction (but try 81 first).
Regards, K.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
GPG fingerprint: 61A0 99A9 8823 3A75 871E 5D90 BADB B237 260C 9C58
Old fingerprint: 2561 E9EC D868 E73C 8AF1 49CF EE50 4B1D CCA1 5170
More information about the ubuntu-users
mailing list