Ubuntu – How to resolve 403 Forbidden on localhost

apache-http-serverlampUbuntu

On a fresh install of ubuntu 12.10, I installed the lamp stack via: sudo apt-get install lamp-server^, and phpmyadmin. Then I sudo chmod 777 /var/www to be able to openly copy and change files in the www folder. I have two issues:

The first is, when I restart the Apache server I get:

apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
 ... waiting apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

The second when I goto localhost in my browser I get the "It Works!", but when I go to localhost/newsite I get a 403 error.

How can I resolve this?

Best Answer

In your httpd.conf add:

ServerName localhost

Then restart Apache.

Related Question