Apache is serving the default page after reboot

Linode Staff

My Ubuntu 16.04 Linode was rebooted and all my sites that were previously working are now showing the default Apache2 page. How can I troubleshoot this?

2 Replies

If your sites were working before the reboot it is likely that changes were made to Apache that would only take effect on a restart of the Apache service. You can view your current loaded virtual hosts with the following command:

apachectl -S

If you do not see your virtual host files there you will need to enable those sites:

sudo a2ensite <nameofsite>.conf

or you can enable it like this, either will work:

cd /etc/apache2/sites-enabled
ln -s /etc/apache2/sites-available/<nameofsite>.conf

Once you've created the enabled your sites, restart apache:

systemctl restart apache2

If when you ran apachectl -S, which lists virtual hosts in the order they are served, and you found that your virtual hosts were enabled, then examine the default sites listed. If you find that '/etc/apache2/sites-enabled/000-default.conf' is listed as the default server for your domain, you can disable it with a2dissite, then restart Apache.

If you're still having issues, then examine the virtual hosts themselves to ensure they are responding to the correct server name and specifying the correct document root. We have a guide here that explains the directives in detail. The official Apache documentation is also useful:

Virtual hosts Virtual host examples Common Apache Misconfigurations

A similar senario was reported here on the Ubuntu forums.

edited by staff: corrected command typo mentioned below

I noticed a small typo in one of the commands above and wanted to put the corrected command here for anyone who comes across this in the future. Instead of:

sudo en2ensite <nameofsite>.conf

You should use:

sudo a2ensite <nameofsite>.conf

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct