1

I've installed the LAMP stack on my Ubuntu 14.04 laptop using the command:

sudo apt-get install apache2

I went to localhost and it shows the typical tree (Index of ... https://i.sstatic.net/DPc8A.png in my case the tree is empty).

So I type at the command line sudo service apache2 start

After that I create a hello world php file, called example.php

And then I put that file inside var/www folder (to getto that folder I go to files and then to system, and then to var folder, and then to www folder).

And finally I open my browser and type localhost/example.php

The file appears as not found.

Note: From the console I've done this also: sudo chmod -R 755 var/www I've also checked www folder perms and anybody has access files and I have "create and delete files" permission.

What should I do? The files are there but localhost show an empty list and Any file is "not found" when I try to acess it from the browser.

Rosamunda
  • 831

1 Answers1

6

In Ubuntu 14.04 the default DocumentRoot is /var/www/html/ instead of /var/www/.

You can change this in /etc/apache2/sites-enabled/000-default.conf (but is usually better to keep it it like this).