How to disable directory indexing from apache2 when moving to the root server?

I need to disable this indexing when I enter my root directory on apache2 server, any hints?

+12
source share
5 answers

If this is only one directory that you want to protect from viewing content, you can also just add index.html or index.php, which will be displayed whenever someone browses this directory.

+7
source

Modify the apache2 configuration file, which is usually located in the directory: "/etc/apache2/httpd.conf".

Add the following or edit if you already have some settings for the default web server directory (/ var / www):

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

This will disable indexing to all public directories.

+34
source

Usually done as follows:

 Options -Indexes 

Minus means no ...

+13
source

Make sure that you also add -Indexes to the configuration files in the directory with the included sites (or in the nodes accessible, as it was in my case), they are usually located in the directory "/ etc / apache2 /".

+1
source

sudo nano / etc / apache2 / apache2.conf

This section <Directory/var/www/> in the file

Add minus to indexes (denied)

Add Plus to FollowSymLinks

Result: <Directory/var/www/> Options -Indexes +FollowSymLinks AllowOverride None Require all granted </Directory>

Powered by Raspbian

You will receive a message: "You do not have access rights to the" Directory "on this server."

0
source

All Articles