Centos 6.3上的Apache2期权指数

weylhg0b  于 2022-11-07  发布在  Apache
关注(0)|答案(2)|浏览(138)

在新安装的Centos 6.3上
我从Ubuntu导入了一个虚拟主机的配置。

DocumentRoot /otherhome/test.cofares.net
ServerName test.cofares.net

<Directory "/otherhome/test.cofares.net">
  allow from all
  Options +Indexes
</Directory>

http://test.cofares.net的请求在错误日志中出现以下错误

Directory index forbidden by Options directive: /otherhome/test.cofares.net/

用于子目录http://test.cofares.net/test的目录索引正常
有什么建议吗?
同样的配置也适用于Ubuntu Server 12.04。

xytpbqjk

xytpbqjk1#

试试这个。并且确保在应用以下命令后重新启动Apache:

<Directory "/otherhome/test.cofares.net">
  Options +Indexes FollowSymLinks
  AllowOverride all
  Order Allow, Deny
  Allow from All
  Satisfy All
</Directory>

也许可以用Satisfy Any来代替:

<Directory "/otherhome/test.cofares.net">
  Options +Indexes FollowSymLinks
  AllowOverride all
  Order Allow, Deny
  Allow from All
  Satisfy Any
</Directory>

**EDIT:**那些看起来不起作用吗?那就试试这个。注意我正在设置整个<VirtualHost>指令,并从<Directory>指令中删除了引号:

<VirtualHost *:80>
   DocumentRoot /otherhome/test.cofares.net
   ServerName test.cofares.net

   <Directory /otherhome/test.cofares.net>
     Options Indexes FollowSymLinks
     Allow from All
   </Directory>

</VirtualHost>
kkih6yb8

kkih6yb82#

经过一点挖掘,我注意到这是一个全局规则(在conf.d/welcome.conf中),它阻止对任何虚拟服务器的/目录进行索引
通过删除它现在是确定的
这是必须改变的规则

<LocationMatch "^/+$">
  Options -Indexes
  ErrorDocument 403 /error/noindex.html
</LocationMatch>

相关问题