Search code examples
apachewampserver

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

Solution

  • my problem is to define 3 vhost point to same directory and this confused apache...finally tnx to riggsfolly i fixed that...beside of this i make changes from this guide to define VHost to have setup things in a right way