You don't have permission to access / on this server when I activate Virtual host in WAMP server

416 views Asked by At

I'm trying to setup a virtual host on my server. I'm in windows server 2012. When I activate the vhost by uncomment the line Include conf/extra/httpd-vhosts.conf , I get this error:

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

This is my httpd-vhosts.conf file

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "e:/wamp/www"
    ServerName localhost
    ServerAlias localhost
    <Directory  "e:/wamp/www">
        AllowOverride All
        <IfDefine APACHE24>
            Require local
        </IfDefine>
        <IfDefine !APACHE24>
            Order Deny,Allow
            Deny from all
            Allow from 127.0.0.0 localhost ::1
        </IfDefine>
    </Directory>
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "e:/wamp/www/test"
    ServerName test.com
    ErrorLog "logs/test-error.log"
    CustomLog "logs/test-access.log" common
</VirtualHost>

Edit

After an day of trying to fix this problem, is this my current httpd-vhosts.conf file:

NameVirtualHost localhost
<VirtualHost localhost>
    DocumentRoot E:/wamp/www/
    ServerName localhost
</VirtualHost>

NameVirtualHost itp-recouvrement.bnpparibas     

<VirtualHost test>     
    DocumentRoot E:/wamp/www/test/
    ServerName exemple.fr
    ServerAlias www.exemple.fr
    ErrorLog "logs/test.log"
    CustomLog "logs/test.log" common
    <Directory />
        Options -Indexes +FollowSymLinks +MultiViews
        AllowOverride All
    </Directory>
</VirtualHost>

This is working locally, but not when I access the server from an another PC, I have same error before

0

There are 0 answers