centos 6.3上的Apache2期权指数
在新安装的Centos 6.3上 我从Ubuntu为virtualhost导入了配置。这是配置的一部分centos 6.3上的Apache2期权指数,apache2,centos,option,virtualhost,indexing,Apache2,Centos,Option,Virtualhost,Indexing,在新安装的Centos 6.3上 我从Ubuntu为virtualhost导入了配置。这是配置的一部分 DocumentRoot /otherhome/test.cofares.net ServerName test.cofares.net <Directory "/otherhome/test.cofares.net"> allow from all Options +Indexes </Directory> 为子目录工作的目录索引正常 有什么建议吗?少了什
DocumentRoot /otherhome/test.cofares.net
ServerName test.cofares.net
<Directory "/otherhome/test.cofares.net">
allow from all
Options +Indexes
</Directory>
为子目录工作的目录索引正常
有什么建议吗?少了什么
同样的配置也适用于Ubuntu服务器12.04
请试试这个。并确保在应用以下命令后重新启动apache:
<Directory "/otherhome/test.cofares.net">
Options +Indexes FollowSymLinks
AllowOverride all
Order Allow, Deny
Allow from All
Satisfy All
</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>
挖掘了一点之后,我注意到conf.d/welcome.conf中有一个全局规则,它阻止对任何虚拟服务器的/目录进行索引 通过移除它,现在就可以了 这是必须改变的规则
<LocationMatch "^/+$">
Options -Indexes
ErrorDocument 403 /error/noindex.html
</LocationMatch>
挖掘之后,我在welcome.conf中发现了有问题的conf,我将其删除。现在一切正常。感谢您的帮助选项-索引ErrorDocument 403/error/noindex.html。我想说的是,CentOS和Ubuntu处理虚拟主机配置的方式没有太大的特殊性,因此如果上述任何一种方式都不起作用,那么它一定是另外一种方式。但很高兴最终成功了!
<VirtualHost *:80>
DocumentRoot /otherhome/test.cofares.net
ServerName test.cofares.net
<Directory /otherhome/test.cofares.net>
Options Indexes FollowSymLinks
Allow from All
</Directory>
</VirtualHost>
<LocationMatch "^/+$">
Options -Indexes
ErrorDocument 403 /error/noindex.html
</LocationMatch>