2015-07-13 98 views
0

我按照這個教程來配置HTTP Apache服務器: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Managing_Confined_Services/chap-Managing_Confined_Services-The_Apache_HTTP_Server.htmlApache配置錯誤403

當我連接使用

telnet localhost 12345 
GET/HTTP/1.0 

我得到一個錯誤

HTTP/1.1 403 Forbidden 

和默認的HTML下面列出了apache。 我試圖配置

/etc/httpd/conf/httpd.conf中

加入

<Directory "/var/www/html"> 
Order allow,deny 
Allow from all 
Require all granted 
</Directory> 

,也跑了

chmod -R o+x /var/www/html 

和我仍然得到相同的錯誤。我如何繼續?

回答

0

你在/ var/www/html /目錄下有一個名爲index.html的文件嗎? 我還建議檢查/ var/log/httpd目錄下的訪問和錯誤日​​志文件

+0

還要確保你已將'/ var/www/html'的onwer更改爲apache用戶。代碼:'sudo chown www-data:www-data/var/www/html -R' –

+0

他可能使用rhel/centos,所以默認的apache用戶是apache而不是www-data。 –

+0

現在雖然這工作正常,我如何使我的網站可見服務器外? – Mike