解决问题 “You don't have permission to access /index.html on this server.”
原文地址:http://www.cnblogs.com/longhs/p/3558201.html
前幾天裝一個linux 企業版5.0安裝了apache,打開測試頁面的時候出現如下錯誤:
ForbiddenYou don't have permission to access /index.html on this server.
開始我以為我配置出錯,花半天時間都沒有搞定,今天終于搞定了.
原因:index.html是用root用戶建的文件,apache權限不夠。
解決方法:更改文件權限;chmod 755 index.html
?
如果是WIN 2003下出現這個問題,請按以下方式解決
打開apache配置文件httpd.conf,找到這么一段:
<Directory />
???? Options FollowSymLinks
???? AllowOverride None
???? Order deny,allow
???? deny from all
???? Satisfy all
</Directory>
然后試著把deny from all中的deny改成了allow,保存后重起了apache,然后再一測試我的網頁,哈哈!居然問題就出在這,訪問測試網站完全正常了。
?
?
第二種方法
是Apache? 的配置文件httpd-vhosts.conf里,打開了擴展配置
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
前面的#去掉了,就 引入了擴展配置,而擴展配置 文件里又沒配好相應 的權限“Allow from all”,所以提示此錯誤
總結
以上是生活随笔為你收集整理的解决问题 “You don't have permission to access /index.html on this server.”的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Apache 创建虚拟主机目录和设置默认
- 下一篇: 分块查询 缓解内存开销