在本地windows环境调试时候 用xampp或wamp里修改了apache\conf\extra\httpd-vhosts.conf ,
添加了虚拟主机,出现 Access forbidden!
字母描述就是没有权限访问。
解决方案:原来在默认httpd.conf ,全局设置如下 (httpd.conf line ~大约188):
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
</Directory>
修改为如下
<Directory />
#Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
Allow from all
</Directory>
顺便还在httpd-vhosts.conf里加了 ,主要是将 localhost 当域名方案
<VirtualHost *:80>
ServerAdmin admin@localhost.com
DocumentRoot “D:/xampp/htdocs”
ServerName localhost
ErrorLog “logs/localhost-error.log”
CustomLog “logs/localhost-access.log” common
</VirtualHost>
至少问题解决了,是否有安全隐患,反正是本地测试无所谓了,重点在代码