2016-10-03 93 views
0

最近修改httpd.conf中和的httpd-vhosts.conf添加虚拟主机...虚拟主机造成403禁止在192.168.1.6 ......其他别名仍然工作

#IncludeOptional "E:/wamp/vhosts/*" 
Include "E:/wamp/alias/*" 

NameVirtualHost *:80 
<VirtualHost *:80> 
    DocumentRoot "e:/wamp/www" 
    ServerName localhost 
    ServerAlias localhost 
    <Directory "e:/wamp/www"> 
     Options Indexes FollowSymLinks 
     AllowOverride All 
     Require local 
     Require ip 192.168.1 
    </Directory> 
</VirtualHost> 

<VirtualHost *:80> 
    DocumentRoot E:/activeWork/projects 
    ServerName projects.local 
     <Directory "E:/activeWork/projects"> 
     Options Indexes FollowSymLinks 
     AllowOverride All 
     Require local 
    </Directory> 

</VirtualHost> 
<VirtualHost *:80> 
    DocumentRoot E:/activeWork/projects 
    ServerName www.projects.local 
     <Directory "E:/activeWork/projects"> 
     Options Indexes FollowSymLinks 
     AllowOverride All 
     Require local 
    </Directory> 
</VirtualHost> 
<VirtualHost *:80> 
    DocumentRoot E:/activeWork/projects 
    ServerName api.projects.local 
     <Directory "E:/activeWork/projects"> 
     Options Indexes FollowSymLinks 
     AllowOverride All 
     Require local 
    </Directory> 
</VirtualHost> 

当我尝试加载192.168.1.6或127.0.0.1,给我:

Forbidden 

You don't have permission to access/on this server. 

我试图解决它丝毫this answer但不是为我工作

recommandation在回答我检查我的access.log这是结果:

192.168.1.6 - - [03/Oct/2016:11:03:00 +0330] "GET/HTTP/1.1" 403 288 
127.0.0.1 - - [03/Oct/2016:11:00:55 +0330] "GET/HTTP/1.1" 403 286 
+0

看到这篇文章它会告诉你如何创建一个[适当和完整的虚拟主机定义](http://stackoverflow.com/questions/23665064/project-links-do-not-work-on-wamp-server/ 23990618#23990618) – RiggsFolly

+0

谢谢...我读了所有这些,并编辑了我的Q,但我的问题是403错误192.168.1.6 –

+0

请向我们展示您的httpd-vhost.conf文件 – RiggsFolly

回答

0

我的问题是定义3虚拟主机指向同一个目录,这个困惑阿帕奇......终于TNX到riggsfolly我固定的...这我旁边让从这个guide to define VHost更改已经设置事情正确的方式

0

,如果你确定你的WAMP的安装路径是里面E: 那么我建议你检查你的访问日志和错误日志收集更多的信息。

+0

这是一条评论,而不是答案 – RiggsFolly

0

我假设您在Wampserver上使用Apache 2.4或更高版本?如果是这样,则更换需要在你的虚拟主机“要求的所有批准”,这样的规则:

<VirtualHost *:80> 
    DocumentRoot "e:/wamp/www" 
    ServerName localhost 
    ServerAlias localhost 
    <Directory "e:/wamp/www"> 
     Options Indexes FollowSymLinks 
     AllowOverride All 
     Require all granted 
    </Directory> 
</VirtualHost> 

如果还是不行,请检查您的防火墙阻止您的访问。