1

Recently I did a "clean" install of Ubuntu 16.04. I also installed MariaDB, Apache2, and PHP 7.0.

Under Ubuntu 14.04 I could see the subdirectories under "/var/www". As a result of this upgrade I can no longer see them with "localhost" under "/var/www". However, "localhost" does show limited files.

For example, "phpmyadmin" shows up OK. And if I type just "localhost", I get the expected "Apache2 Ubuntu Default Page" that is located in the "html" directory. Also if I type in "http://localhost/index.php", I get can the phpinfo() page.

However, if I type in: "http://localhost/PHP_Intermediate/store/admin/admin.php" I get the 404 error message: "The requested URL /PHP_Intermediate/store/admin/admin.php was not found on this server."

The owner of all the files has been set to "www-data" with anyone temporarily having read/write/access privileges for testing.

How can subdirectory viewing (access) be enabled for "var/www"?

Steve R.
  • 418

1 Answers1

1

I have apparently located an answer. I noticed in phpinfo() that DOCUMENT_ROOT = /var/www/html. I did an internet search to locate the file that string is located in. The file is /etc/apache2/sites-enabled/000-default-conf. See code below. "#" out the line with html in it and added a new line without html.

ServerAdmin webmaster@localhost
#DocumentRoot /var/www/html
 DocumentRoot /var/www

Solution found at this website: Changing apache2 document root

In subsequent browsing, I ran across another post that speaks of this issue: What changed in apache2 from saucy to trusty for projects in /var/www [duplicate]

Steve R.
  • 418