[英]Why does WAMP says this:“Forbidden You don't have permission to access / on this server.”?
[英]Don't Have Permission To Access / On This Server
我已經看了看SO這么多類似的問題是這一個 ,我甚至可以通過在全局目錄的修改解決我的問題。 但是,我想在httpd-vhosts.conf文件中進行更改。 這是我目前擁有的:
<VirtualHost *:80>
ServerAdmin someEmail@gmail.com
DocumentRoot "c:/www/firstSite.dev"
<Directory "c:/www/firstSite.dev/">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
Allow from all
</Directory>
ServerName firstSite.dev
</VirtualHost>
但是,我仍然收到錯誤:
禁止的
您無權訪問此服務器上的/。
任何幫助,將不勝感激。
您需要在httpd.conf文件中顯式添加用戶。 下面的行會做的trick
User daemon
Group daemon
User *user here*
如果您碰巧在包含SELinux之類的Linux發行版(例如CentOS)上,則需要確保為文檔根文件正確設置了SELinux權限,否則會出現此錯誤。 在RedHat / CentOS / Scientific Linux上,可以通過編輯/ etc / sysconfig / selinux來完成-找到參數“ selinux”並將選項“ enforcing”更改為“ disabled”:
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
然后重新啟動服務器並進行測試。 如果能夠解決問題,則可以禁用SELinux,也可以配置SELinux以訪問站點。 這是配置SELinux的很好的教程: http : //beginlinux.com/server_training/web-server/976-apache-and-selinux
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.