234rfe 发表于 2015-11-18 08:56:57

xampp下新增virtualhost出现access denied

在xampp新增了一个virtualhost:

1
2
3
4
5
6
7
8
9
10
11
<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>





1
然后访问http://127.0.0.11:80,出现403禁止访问错误,google之后发现httpd.conf文件有默认的配置,





1
2
3
4
5
<Directory "D:/xampp/cgi-bin">
    AllowOverride All
    Options None
    Require all denied
</Directory>




修改require为all granted即可。


1
2
3
4
5
<Directory "D:/xampp/cgi-bin">
    AllowOverride All
    Options None
    Require all granted
</Directory>




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

1
2
3
4
5
6
7
<Directory "E:/workspacePHP/personalSite">
   Options Indexes FollowSymLinks
   AllowOverride All
   Order Allow,Deny
   Allow from all
   Require all granted
</Directory>




遇到的问题,此处mark一下。

页: [1]
查看完整版本: xampp下新增virtualhost出现access denied