Zend framework2 在win7上不同目录的wamp 2.5中创建vhost返回禁止的错误
我已经在C:\wamp中安装了wamp,我想将E:\zf2中的DocumentRoot文件夹作为虚拟域www.skeltonaplicaiton-zf2.local的虚拟主机 未提交的行包括httpd.conf文件中的conf/extra/httpd-vhosts.conf httpd-vhosts.conf代码为Zend framework2 在win7上不同目录的wamp 2.5中创建vhost返回禁止的错误,zend-framework2,wamp,virtualhost,Zend Framework2,Wamp,Virtualhost,我已经在C:\wamp中安装了wamp,我想将E:\zf2中的DocumentRoot文件夹作为虚拟域www.skeltonaplicaiton-zf2.local的虚拟主机 未提交的行包括httpd.conf文件中的conf/extra/httpd-vhosts.conf httpd-vhosts.conf代码为 <VirtualHost *:80> ServerName www.skeltonapplicaiton-zf2.local ServerAlias sk
<VirtualHost *:80>
ServerName www.skeltonapplicaiton-zf2.local
ServerAlias skeltonapplicaiton-zf2.local
DocumentRoot "E:\zf2"
<directory "E:\zf2">
Options Indexes FollowSymLinks
AllowOverride all
Order Deny,Allow
Deny from all
Allow from all
</directory>
</VirtualHost>
然后重新启动wamp服务器
在浏览器中打开www.skeltonaplicaiton-zf2.local后,出现错误
Forbidden
You don't have permission to access / on this server.
Apache错误日志为
[Fri Aug 08 11:00:41.940054 2014] [authz_core:error] [pid 7256:tid 796] [client 127.0.0.1:59500] AH01630: client denied by server configuration: E:/zf2/
您的all设置是正确的,但是Apache2.4(wamp 2.5使用Apache2.4)中有一些更改,即删除了指令Allow而改为新的指令Require。正确的配置将与虚拟主机相同
<VirtualHost *:80>
ServerName www.skeltonapplicaiton-zf2.local
ServerAlias skeltonapplicaiton-zf2.local
DocumentRoot "E:\zf2"
<directory "E:\zf2">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</directory>
</VirtualHost>
和使用
Require all granted
除非你真的想让世界看到你的网站,至少在你开发网站时,最好使用
Require local
,因为这涵盖了127.0.0.1和localhost and::1
你的意思是,我应该使用“Require local”来访问localhost,而不是使用“Require all-grated”。对吗?
Order Deny,Allow
Deny from all
Allow from all
Require all granted