How to disable directory listing to /icons/
directory on Debian Lenny Linux
I've recently configured a new server running Debian Lenny Linux.
It really irritated me that by default an Alias existed to the
/icons/ directory.
It took me a while to get through the configured Virtualhosts in
/etc/apache2/sites-enabled/ , the
/etc/apache2/apache2.conf and check among the enabled Apache
modueles existing in
/etc/apache2/mods-avaiable/
I finally got that the
Alias to the directory was because of
a configuration directives in
/etc/apache2/mods-available/alias.conf
To disable the Alias you'll have to:
debian-server:~# vim
/etc/apache2/mods-available/alias.conf
Then Change in the
/etc/apache2/mods-available/alias.conf :
<Directory "/usr/share/apache2/icons">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Allow from all to
to Deny from all in order to forbid
access to the
/icons/ directory.
If you want to completely wipe out the
Alias comment out the
line:
Alias /icons/ "/usr/share/apache2/icons/"
Now restart Apache and the access to the
/icons directory
enabled by default on Debian would be no more :)
debian-server:~# /etc/init.d/apache2 restart
Cheers :)