Apache – Disable directory browsing in Debian

Disable directory browsing

Disable directory browsingIf you have directory browsing enabled, which it is by default, your users can browse the directories on your web server. This is not particularly good regarding security. So we better disable directory browsing to be on the safe side.

On a Debian server we do that quite easily in the domain config at /etc/apache2/sites-available/
If you have setup more than one domain on your web server, you should go to your domains config file. Here is an example: ‹/etc/apache2/sites-available/example.com.conf
(if you use Apache prior to 2.4 you might not have the .conf extension)

Insert this line into the config file: Options -Indexes

If you only have one domain hosted on your server, you most likely uses the default domain config.
Edit this file: /etc/apache2/sites-available/default
Look for the line: Options Indexes FollowSymLinks MultiViews ExecCGI
And change to: Options -Indexes FollowSymLinks MultiViews ExecCGI

You can now restart or reload your apache server.
service apache2 restart

We have now done disable directory browsing.

Happy browsing!

Related Posts

4 Best Free Nas Software That Is Open Source

Free NAS software or operating systems that are free to use and will turn a computer into a NAS more advanced than the dedicated boxes sold. What…

Raspbian default password

Raspbian default password

Looking for the Raspbian default password? It is the most essential username and password that you will need for your raspberry. At least if you are running…

OpenMediaVault default password

OpenMediaVault default password

OpenMediaVault default password is printed in the documentation. I did not see it the first time I installed it either. So I had to do some detective…

Debian change dns

Debian change DNS settings to a new DNS

Debian change DNS settings for speed improvement or privacy. It is really easy to do. So let us see how it’s done and get to it. The…

Upgrade debian 9 to debian 10

Upgrade Debian 9 to Debian 10

Upgrade Debian 9 to Debian 10 is very similar to upgrading previous versions. The only you need to do is change the sources to Buster instead of…

Debian 10 Static IP

Debian 10 Static IP

Debian 10 static IP works just like the previous version. They changed the naming of the network interfaces in Debian 9. However if you have upgraded from…

Leave a Reply