Question: How can I disable building of directory index in apache/httpd? In other words, how to prevent users from seeing the contents of published directories?

apache directory index

Answer: Actually you are totally right that you wish to disable this feature. One of the “must do’s” on setting a secure apache web server is to disable directory browsing. Usually apache comes with this feature enabled but its always a good idea to get it disabled unless you really need it.

First of all find where is the main apache’s config file httpd.conf is located. If you use Debian, it should be here: /etc/apache/httpd.conf. Using some file editor like Vim or Nano open this file and find the line that looks as follows:

Options Includes Indexes FollowSymLinks MultiViews

then remove word Indexes and save the file. The line should look like this one:

Options Includes FollowSymLinks MultiViews

After it is done, restart apache (e.g. /etc/init.d/apache restart in Debian). That’s it! :)

 

9 Comments

 

  1. June 3, 2008  1:20 pm by Lars Reply

    there is a copy-paste mistake, when u say, u'll remove, u should remove the word 'Indexes' ;)

  2. April 23, 2011  10:56 pm by the best seo software Reply

    It’s truly a great and helpful piece of info. I’m satisfied that you simply shared this useful info with us. Please stay us up to date like this. Thanks for sharing. Do you know anything about SEO Software?

  3. April 27, 2011  7:42 pm by 4life Reply

    Thanks for the sensible critique. Me and my friend were just preparing to do a little research on this. We got a book from our area library but I think I learned more from this post. I'm very glad to see such wonderful info being shared freely out there...

  4. April 29, 2011  4:54 pm by cheapest car incurance Reply

    Thanx for a very interesting site. What else may I get that type of information written in such a perfect manner? I've a challenge that I am simply now operating on, and I have been at the look out for such info.

  5. May 2, 2011  11:28 pm by constructive dismissal Reply

    I have been absent for some time, but now I remember why I used to love this website. Thank you, I’ll try and check back more often. How often do you update your blog?

  6. May 3, 2011  4:06 pm by achieve anything Reply

    I was just searching for this info for some time. After six hours of continuous Googleing, finally I got it in your website. I wonder what is the Google's issue that doesn't rank this type of informative websites closer to the top. Normally the top web sites are full of garbage.

  7. May 3, 2011  4:09 pm by best self help book Reply

    Hey. Neat article. There is an issue with your website in internet explorer, and you might want to check this... The browser is the marketplace chief and a good portion of folks will omit your great writing due to this problem.

  8. May 4, 2011  1:20 pm by mma workout Reply

    Hello there. I found your web site by means of Google even as looking for a similar topic, your web site came up. It looks good. I have bookmarked it in my google bookmarks to come back later.

Leave a reply

 

Your email address will not be published.