April 23, 2020
Estimated Post Reading Time ~

How to Disable Directory Listing in Apache Webserver

Environment: Apache Webserver
Solution:
- In the absence of index file by default apache server will list the default content root directories
- We can turn off the directory listing by using Options directive in the httpd.conf or apache2.conf configuration file for any specific directory

1. Open the Httpd.conf or apache2.conf file

Options –Indexes

2. Restart the server
3. Go to website and access for the content root -/var/www/html or /content
4. You must see the Forbidden error(You don’t have permission to access/ on this server.


By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.