如何防止目录浏览?

时间:2014-07-24 10:52:52

标签: linux apache

我想禁用Apache服务器上的目录浏览。我更改了/etc/httpd/conf/httpd.conf文件以删除Indexes

# Comment out old:
# Options Indexes FollowSymLinks 
# New:
Options FollowSymLinks

我用apachectl -k restart重新启动了Apache。

但是,由于目录列表仍然可行,因此无法正常工作。

我正在运行CentOS 5.8 linux和Plesk 11.

怎么办?

1 个答案:

答案 0 :(得分:1)

我认为您正在寻找索引选项:

Options All -Indexes

您可以简单地将此行放入您的www根目录中的.htaccess或您希望所有子文件夹拒绝列表的任何文件夹中。

或在httpd.conf中:

<Directory /var/www>
    Options -Indexes
</Directory>
相关问题