View Full Version : Disabling Directory Browsing in Apache2
fsgpr
September 11th, 2006, 01:53 PM
I have an Apache2 server setup using Mod_Python with Ubuntu 6.06 and would like to know how to disable directory browsing.
I already tried deleting "Indexes" from the /etc/apache2/apache2.conf file as I found on Google and restarting Apache2 (sudo apache2 -k restart), but I can still browse through directories...
Anything else that needs to be modified?
kidders
September 11th, 2006, 02:17 PM
Hi there,
There may be other places you need to remove that directive from ... it really depends on how your apache is configured. Try searching your apache config files (there are quite a few!) for other occurrences of the "indexes" directive that might apply to your directory.
fsgpr
September 11th, 2006, 03:17 PM
Thanks for the pointer.
It turned out to be in /etc/apache2/sites-available/default
kidders
September 11th, 2006, 06:01 PM
Great news :-)
Those individual site settings override any default ones you specify elsewhere. Of course, a .htaccess file can, in turn, override those.
Best of luck!
ruthgard
July 17th, 2008, 04:40 AM
I noticed that it did not help to just remove the Indexes word from the configuration. I allso had to add the global(ie not wrapped in any other configuration block as Directory or such) option:
Option -Indexes
to the /etc/apache2/apache2.conf and then restart apache. Now I get the forbidden message when I try to access a folder, just as I wanted it to.
vBulletin® v3.8.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.