简体   繁体   中英

Virtual Hosts on WAMP causing 403 forbidden on 192.168.1.6… other aliases still work

recently modified httpd.conf and httpd-vhosts.conf to add vhosts...

    #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>

after that when i try to load 192.168.1.6 or 127.0.0.1 , gives me :

Forbidden

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

i've tried to solve it whit this answer but not works for me

and by recommandation in answers i check my access.log and this is the result:

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

如果您确定wamp的安装路径在E:内,则建议您检查访问日志和错误日志以收集更多信息。

I assume you are using Apache 2.4 or later on your Wampserver? If so, then replace the require rules with "Require all granted" in your vhosts, like this:

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

If it still doesn't work, check if your firewall is blocking your access.

我的问题是定义3个vhost指向同一目录,并且这个混淆的apache ...最终tnx到riggsfolly我修复了...除了此,我对本指南进行了更改以定义VHost以正确的方式进行设置

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM