1. 程式人生 > >解決問題 “You don't have permission to access /index.html on this server.”

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

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

Forbidden

You 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”,所以提示此錯誤