Recently apache2 fails to start at boot, but can be started OK manually

Chris Green cl at isbd.net
Tue Oct 26 17:57:32 UTC 2021


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 on that
> address and port. If you can start Apache2 later, then it would appear
> that whatever else was listening has stopped listening by then.
> 
Unlkely, the error in that case is usually "address already in use"
and that's not what we're seeing.


> You can confirm this by configuring Apache2 to use a different port,
> like 81, and see if it then starts properly on boot. If the same
> problem still happens, it is a resource issue of some kind, or possibly
> permissions.
> 
I might try that if nothing else obvious pops up.


> Think back to two weeks ago; did you install anything new that might be
> listening for a while on port 80? Also check the logs for something
> dying during startup.
> 
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'.


> Can you start later Apache2 using "systemctl start apache2" instead of
> "/etc/init.d/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.


> 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.

-- 
Chris Green




More information about the ubuntu-users mailing list