I was learning how to configure LAMP server on Ubuntu machine. I was following the given website


I created the info.php file using

 sudo nano /var/www/info.php

to contain the following lines


Then having restarted the apache2 service using

sudo service apache2 restart

I used the ifconfig command to find the inet address. The line in the output was

inet addr:  Bcast:  Mask:

So, as per the instructions on the link, I typed the following in the address bar of Mozilla browser

The tutorial says the a web page similar to


should open but in my case, the page could not be loaded. The error I received is

The requested URL /info.php was not found on this server.
Apache/2.4.7 (Ubuntu) Server at Port 80

Where am I missing out on?

closed as unclear what you're asking by Jeff Schaller, PersianGulf, dr01, MelBurslan, jimmij Jun 6 '16 at 15:22


  • Did you add php as an index file too? – Jeff Schaller Jun 5 '16 at 13:37
  • no...it wasn't there in the instructions – Upendra Pratap Singh Jun 5 '16 at 17:11
  • "After you answer yes to the prompt twice, PHP will install itself. It may also be useful to add php to the directory index, to serve the relevant php index files: sudo nano /etc/apache2/mods-enabled/dir.conf Add index.php to the beginning of index files." – Jeff Schaller Jun 5 '16 at 17:55

I believe the default DocumentRoot for apache is /var/www/html, so try moving your php file there by doing:

 sudo mv /var/www/info.php /var/www/html/

If apache then complains that it cannot read the file, try sudo chmod a+r /var/www/html/info.php.
