0

I recently update from Ubuntu 12.04 to 14.04. As part of this upgrade process, my version of Apache was also update from 2.2 to 2.4, which I understand is a significant change for some reason.

Somewhere along the way Apache got messed up so I had to remove it and then reinstall. Now that Apache has been reinstalled the problem I am having is that I cannot access http://localhost. With a fresh install of Apache 2.4, I cannot get it to work.

When I do sudo /etc/init.d/apache2 restart and sudo service apache2 restart these do not throw any errors, so I don't know what the problem could be.

How can I troubleshoot my new Apache installation? Thanks.

1 Answers1

0

Having just encountered a similar problem myself, here are some steps...

1.

Check whether apache is running (like you already did)

sudo service apache2 restart

This command will attempt to (re)start apache, printing out status info while doing so. If you get an error here, that's your next clue to follow until you get apache running.

2.

With apache running, watch its logs while attempting to visit one of your server's pages.

sudo tail -f /var/log/apache2/error.log /var/log/apache2/access.log

This command will print out the end ("tail") of the apache error and access logs, and it will "live print" new logs as they arrive.

If you see new error logs arriving while you attempt to visit one of your apache's webpages, then those are your next clues to follow.

If apache returns a response to your browser (ie: "Forbidden"), then that is one of your clues to follow.

If you see no new error logs or even no new access logs, then the problem is likely not with apache.

3.

In my case, this lead me to the following places:

And I personally needed the following fixes:

  1. My vhost files (see /etc/apache2/sites-available/) needed to be suffixed with .conf, as described in this stack-o answer.
  2. I needed to have Require directives added to my vhosts, as described in the upgrade docs.
David
  • 193