安装Wampserver2.5,一切顺利,但配置完虚拟主机,如下:
<VirtualHost *:80>
ServerName www.sitename.com
DocumentRoot "D:/path/foldername"
ErrorLog "logs/eims-error.log"
CustomLog "logs/eims-access.log" combined
<Directory " D:/path/foldername ">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
访问配置的本地域名,会报错:
Forbidden
You don't have permission to access / on this server.
Apache/2.4.9 (Win32) PHP/5.5.12 Server at www.sitename.com Port 80
解决方法如下:
启用rewrite_moudle。
尝试启用,重启Apache后,情况没变,还是403错误。
修改vhosts配置文件中的一句,这才是关键:
Allow from all 修改成 Require all granted
测试成功,问题解决。
究其原因在于wamp2.5 apache配置文件的语法变了,新版的配置方法跟旧版的差异,详细可见:
http://www.jb51.net/article/61193.htm