xampp下新增virtualhost出現access denied

在xampp新增了一個virtualhost:

<VirtualHost 127.0.0.11:80>  
   DocumentRoot E:/workspacePHP/personalSite
   ServerName 127.0.0.11:80  
</VirtualHost>  

<Directory "E:/workspacePHP/personalSite">  
   Options Indexes FollowSymLinks 
   AllowOverride All 
   Order Allow,Deny
   Allow from all  
</Directory>
然後訪問http://127.0.0.11:80,出現403禁止訪問錯誤,google之後發現httpd.conf文件有默認的配置,
<Directory "D:/xampp/cgi-bin">
    AllowOverride All
    Options None
    Require all denied
</Directory>

修改require爲all granted即可。

<Directory "D:/xampp/cgi-bin">
    AllowOverride All
    Options None
    Require all granted
</Directory>

或者在新增的Directory增加require all granted:

<Directory "E:/workspacePHP/personalSite">  
   Options Indexes FollowSymLinks 
   AllowOverride All 
   Order Allow,Deny
   Allow from all  
   Require all granted
</Directory>

遇到的問題,此處mark一下。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章