-1

The document root in 000-default.conf is /var/www/html. The Directory is set as <Directory /var/www/html/>. There is an index.html in /var/www/html. However apache 2.4.7 shows me the directory listing of / instead of the index.html in /var/www/html for the website. What should I be looking to change?

user10211
  • 19
  • 1
  • 5

1 Answers1

0

Add DirectoryIndex index.html to your default virtual host definition or global config. Check whether you have mod_dir enabled.

sam_pan_mariusz
  • 2,133
  • 1
  • 14
  • 15
  • I do have `DirectoryIndex index.html` in my virtual host defintiion and mod_dir is enabled as well. – user10211 Jan 18 '16 at 22:10
  • Are use sure the DNS name used in browser isn't defined in another virtual host? Please provide contents of /etc/apache2/mods-enabled/mod_dir.* files and the entire /etc/apache/sites-enabled/000-default.conf. – sam_pan_mariusz Jan 19 '16 at 06:12
  • I managed to solve it. The problem was within the `Directory` directive in `000-defualt.conf`, `AllowOverride` was set to `None`. Once I set it to `All` everything worked as expected. Thanks a lot for the attention to the question - not sure why it was down-voted. – user10211 Jan 20 '16 at 12:39
  • Setting `AllowOverride` only changes whether *.htaccess* files can override config file settings. You should especially avoid setting it to `All`, as it is potentially insecure. – sam_pan_mariusz Jan 20 '16 at 19:05