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
  • Please edit your question to use code blocks. It looks a lot nicer that way. Thanks! – You'reAGitForNotUsingGit Aug 13 '16 at 16:27
  • Take a look at the error_log. You should have a more detailed information about what went wrong. You will also see what file is apache looking for and check if it really exists on disk. – nobody Aug 13 '16 at 17:27
  • No error messages are displayed. Nevertheless the error log implied a security issue. I turned off the "SSL Engine Switch". No effect. Still can't access my other web-pages under "www" – Steve R. Aug 13 '16 at 18:07
  • As a test, I moved one of the existing subdirectories into "var/www/html", and "localhost" displayed the files as expected. Need to do a bit more work to verify that the issue can be resolved in this manner. – Steve R. Aug 13 '16 at 18:46

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