> Linux服务器 > apache >

apache禁止显示目录索引的方法

apache禁止显示目录索引

apache显示目录索引很不安全,下面是操作方法。

在httpd.conf文件搜索关键字"Indexes "。

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
 
出掉Indexes关键字,修改如下:
<Directory "/var/www/html">
    Options  FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>  (责任编辑:IT)