[英]Apache2 Option index on centos 6.3
在新安裝的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>
稍作研究后,我注意到thire是一個全局規則(在conf.d / welcome.conf中),該索引防止索引任何虛擬服務器的/目錄
通過刪除它現在可以了
這是必須更改的規則
<LocationMatch "^/+$">
Options -Indexes
ErrorDocument 403 /error/noindex.html
</LocationMatch>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.