How to stop Apache from listing the contents of my user directories

前端 未结 2 1593
北恋
北恋 2021-01-24 14:10

I recently ran some penetration testing software on my web site and was surprised for it to report that one of my directory listings was publicly accessible.

相关标签:
2条回答
  • 2021-01-24 15:00

    You could create a .htaccess file in that directory, or have a <directory>...</directory> block in your Apache configuration that specifies:

    
    Options -Indexes
    

    See the Apache options directive documentation for more details.

    0 讨论(0)
  • 2021-01-24 15:12

    There is a command in Apache that will make it show indexes.

    Options +Indexes
    

    Remove this, restart. This will make that url show a 403 Forbidden.

    0 讨论(0)
提交回复
热议问题