Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable directory indexing from apache2 when going to the server's root?

Tags:

I need to disable that indexing when I enter on my root directory on a apache2 server, any tips?

like image 506
Lucas Famelli Avatar asked Jun 13 '11 17:06

Lucas Famelli


2 Answers

Edit your apache2 configuration file which normally is on the dir: "/etc/apache2/httpd.conf".

Add the following or edit if your already have some configurations for the default web server dir (/var/www):

 <Directory /var/www>    Options -Indexes    AllowOverride All    Order allow,deny    Allow from all  </Directory> 

This will disable the indexing to all the public directories.

like image 147
joruro Avatar answered Sep 18 '22 07:09

joruro


Usually done like this:

Options -Indexes 

The minus means "no"...

like image 30
AJ. Avatar answered Sep 22 '22 07:09

AJ.