0

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
Community
  • 1
  • 1
mohammadreza khalifeh
  • 1,510
  • 2
  • 18
  • 32

3 Answers3

0

if you are sure that your wamp Installation path is inside E: then I suggest you to check your access log and error log to collect more information.

mahyard
  • 1,230
  • 1
  • 13
  • 34
0

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.

Daniel H.J.
  • 438
  • 4
  • 9
0

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

Community
  • 1
  • 1
mohammadreza khalifeh
  • 1,510
  • 2
  • 18
  • 32