解決問題 「You don't have permission to access /index.html on this server.」

前幾天裝一個linux 企業版5.0安裝了apache,打開測試頁面的時候出現以下錯誤:html

Forbidden

You don't have permission to access /index.html on this server.linux

開始我覺得我配置出錯,花半天時間都沒有搞定,今天終於搞定了.apache

緣由:index.html是用root用戶建的文件,apache權限不夠。ide

解決方法:更改文件權限;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,而後再一測試個人網頁,哈哈!竟然問題就出在這,訪問測試網站徹底正常了。this

 

 

第二種方法server

是Apache  的配置文件httpd-vhosts.conf裏,打開了擴展配置 htm

# Virtual hosts
Include conf/extra/httpd-vhosts.confio

前面的#去掉了,就 引入了擴展配置,而擴展配置 文件裏又沒配好相應 的權限「Allow from all」,因此提示此錯誤

相關文章
相關標籤/搜索