今天apache创建了一个虚拟主机,绑定好域名发现访问出现 403 Forbidden:You don't have permission to access / on this server.权限又不够 了?
马上打开apache的配置文件httpd.conf,逐行检查。在大约快一半的地方有以下这段代码:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
发现了吧。由于配置了php后,这里的“Deny from all”已经拒绝了一切连接。把该行改成“allow from all”,修改后的代码如下,问题解决。
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
allow from all
</Directory>
Options FollowSymLinks
AllowOverride None
Order deny,allow
allow from all
</Directory>
再次在浏览器里打开http://localhost,显示it works!