How to disable Directory Listing?

From what I can read changing

Options All Indexes FollowSymLinks MultiViews 

to

Options All FollowSymLinks MultiViews

in httpd.conf should disable directory listing, but I can still list them.

I have only been able to disable this using .htaccess files.

Question

How do I disable directory listing in httpd.conf for DocumentRoot and all VirtualHost's?


No, it doesn't work like that, the All means enable all options except MultiViews, the order is also important. To disable directory listings you need -Indexes so

Options All FollowSymLinks MultiViews -Indexes 

would work but

Options -Indexes All FollowSymLinks MultiViews

wouldn't as the All after the -Indexes would re-enable it.


You should put this on your httpd.conf to disable indexes globally:

Options -Indexes

Then you should check all your virtual hosts to see if they have it explicitly enabled.

This blog post might be helpful to understand how directory listing works.