Apache2 always times out after reboot

I’ve just upgraded to Ubuntu 18.04. Reboot often takes 10 minutes or more. During this, apache2 often times out and I had to change restart from “on-abort” to “always” in order not to loose the server whenever the system reboots.

I can immediately ping the system and get to the login via ssh, but it takes multiple minutes until the password is accepted. There are no error messages when booting from the digitalocean console, none in journalctl, and no problems reported in systemd-analyze. Using “systemd-analyze blame” I can see that it sometimes takes multiple minutes until the multi-user runlevel is started.

What could be potential culprits for such behavior? Thanks!

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Thank you. I would not know which service times out, as there are no error messages on the boot screen or in the journal.

Restarting apache2 while the machine is running is very fast.

Thank you for pointing out services. I’ve set the default target to be “” instead of “” and disabled “wpa_supplicant.service” to speed things up. I will further monitor this and post a solution here.

Hi @nikolaus,

Often when something takes this long it’s because it’s trying to connect/open something it doesn’t have access to and it’s waiting for it’s timeout to expire.

Regarding Apache, when you reboot the server, are you sure there is nothing else actually listening on the ports Apache will try to listen (80, 443)? One other thing, when you try and restart Apache manually does it take a long time to do so?

Lastly, I’ll recommend checking all the services which are configured to start automatically on reboot, most probably the issues lies there in one of them. To check this, you can run

sudo systemctl list-unit-files --type=service

If you want to show only the Enabled services, then run

sudo systemctl list-unit-files --type=service | grep enabled

Regards, KDSys