Tuesday, July 30, 2013

Disabling directory listings in apache2 and ubuntu

To disable directory listings for a website using apache2 and ubuntu, edit the file
/etc/apache2/sites-available/default

Change the lines:

        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews

to put a - in front of Indexes

        <Directory /var/www/>
                Options -Indexes FollowSymLinks MultiViews

save the file and then restart apache using
/etc/init.d/apache2 restart

No comments:

Post a Comment