Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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 3 '12 at 12:44

1 Answer 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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.