2

I have a relatively fresh installation of LAMP on Ubuntu 12.04 (installed using tasksel). I've got a virtual host pointed at a development project in my home directory containing plain Hello World index.html. Apache is showing the directory index instead of displaying the index.html. The PDF here(page 190) says that the default DirectoryIndex is in /etc/apache2/mods-available/dir.conf, which I've confirmed, and mod_dir is enabled.

DirectoryIndex works inside a .htaccess in the project root directory, but I'd like to have it set up server-wide. I'm probably missing something simple.

James
  • 21
  • 1
  • 3
  • You probably done something wrong, Apache display index.html instead of the directory by default. Did you already changed somethin in it ? – x_vi_r Jul 03 '12 at 12:44

1 Answers1

1

Don't mess with apache configuration files unless you know what you're doing.

If you want to edit the Apache2 default site edit /etc/apache2/sites-available/default add to the VirtualHost section the name(s) of the file you want apache to search, more info at http://httpd.apache.org/docs/2.0/mod/mod_dir.html ex:

    DirectoryIndex  lookforme-first.html lookforme-next.php

afterward reload apache with sudo service apache2 reload.

perdigueiro
  • 135
  • 1