centos 6.3 上的 Apache2 选项索引

标签 apache2 centos option virtualhost indexing

在新安装的 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。

问候

最佳答案

尝试这个。并确保在应用后重新启动 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>

编辑:那些似乎不起作用?然后试试这个。注意我正在设置整个 <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>

关于centos 6.3 上的 Apache2 选项索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14535487/

相关文章:

php - 从 Php 执行 Python 脚本

django - AH01630 : client denied by server configuration in Django

Php 错误 : failed to open stream: Permission denied in CentOS 7. 1.1503(核心)

excel - 从下拉列表中选择一个选项 excel vba 抓取

c++ - 无法在 Kubuntu 10 上运行 c++ cgi。检查了所有 apache 配置+exec+cgi-bin+api

ubuntu - 为什么 my-domain.com 不适用于 www

centos - 为什么 rpmbuild 需要这些 C++ 库,从而导致此错误?

java - 在同一个 Process 对象上调用 Runtime.getRuntime.exec(commands) 两次

css - 仅显示多项选择中的第一个选项

scala - 在集合类型中对当前极值进行评分的最佳方法