当我在WAMP服务器中激活虚拟主机时,您无权访问/在此服务器上

时间:2015-06-25 16:39:30

标签: apache wamp vhosts

我试图在我的服务器上设置虚拟主机。我在Windows Server 2012中。当我通过取消注释行vhost来激活Include conf/extra/httpd-vhosts.conf时,我收到此错误:

  

您无权访问此服务器

这是我的httpd-vhosts.conf文件

<VirtualHost *:80>
    ServerAdmin webmaster@homemail.net
    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 webmaster@dummy-host2.example.com
    DocumentRoot "e:/wamp/www/test"
    ServerName test.com
    ErrorLog "logs/test-error.log"
    CustomLog "logs/test-access.log" common
</VirtualHost>

修改

在尝试解决此问题一天后,这是我当前的httpd-vhosts.conf文件:

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>

这在本地工作,但是当我从另一台PC访问服务器时,我在

之前有同样的错误

0 个答案:

没有答案