Disable autoindex in Apache

It is quite annoying and can be a security problem if visitors can see the content of a folder while browsing your site.

I have found three ways of managing this

1. Disabling the module globally

a2dismod autoindex
or
sudo a2dismod autoindex
if in Debian or Ubuntu

2. Changing it with a line in the .htaccess of the folder

two options:
Options -Indexes
that will show as forbidden

or

IndexIgnore *
that will show it as empty

3. Modifying the /etc/apache2/sites-enabled/default

where you see:


Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

Remove “Indexes”

More info here:
http://www.mywebexperiences.com/2013/05/20/how-to-disable-directory-listing-in-apache/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s