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!

About Author

Related Posts

php8 gd

PHP8 gd Activate after installation

PHP8 GD activate after installation. GD doesn’t get activated by default. Not even a reboot after installation will activate it. So how do we do it? In…

wordpress page not found

WordPress page not found after changing permalinks

Permalinks are a critical aspect of a WordPress website’s structure, providing user-friendly URLs that enhance both SEO and user experience. However, occasionally, WordPress users encounter permalink issues…

Debian 12: linux-image-6.1.0-10amd64

Troubleshooting dependency issues in Debian 12: Resolving linux-image-6.1.0-10amd64 package dependency problems. If you installed the Debian 12 from the live image the issue is the raspi-firmware. Even…

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…

Leave a Reply