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 am trying to turn off the web directory browsing, like if somebody goes to a page where index.html or index.php doesn't exist, then it brings up a list of directories. I found this page that looked like it had the answer. It told me to add a "-" in front of the indexes so that his httpd.conf file went from:

<Directory "/u01/app/apache/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

to

<Directory "/u01/app/apache/htdocs">
    Options -Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

So mine looks like this:

<Directory "/var/www/html">
        AllowOverride All
        Options FollowSymLinks Includes Indexes MultiViews All
    Order Allow,Deny
        Allow from All
</Directory>

And I tried doing the same thing: adding a "-" in front of "indexes":

<Directory "/var/www/html">
        AllowOverride All
        Options FollowSymLinks Includes -Indexes MultiViews All
    Order Allow,Deny
        Allow from All
</Directory>

But it hasn't made any effect after I restarted apache, do I need to take out "All" or something? Any advice would help, thank you!

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

You guessed it: the word All in Options is undoing you here. Drop that and you'll be all set.

share|improve this answer
    
Excellent, thank you! Not sure why that was set, perhaps it was due to a codeigniter installation, everything seems to be working without though –  Doug Molineux May 12 '11 at 2:53
1  
You can also, for what it's worth, just move All to the front of the list (i.e. do something like All -Indexes). –  BMDan May 12 '11 at 3:10
add comment

Remove the word Indexes and restart Apache that should fix it. Also you have the

AllowOverride All

in your config which would still allow anyone who specified the Indexes option in htdocs to enable directory listing.

share|improve this answer
add comment

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.