2017-02-09 28 views
0

今天,我试图为我的新Web项目配置一个VHOST,但我遇到了一个问题,我无法解决...即使在StackOverflow的帮助下也没有......XAMPP WIndows VHOST总是指挥本地主机

我配置了我的“httpd-vhosts.conf”,正如我在现在阅读的很多教程中提到的那样,并且像教程中提到的那样设置了我的主机文件...

我还检查了我的虚拟主机文件是由Apache的httpd.conf(它是)包括

所以这里是我的配置:

VHOST:

NameVirtualHost *:80 
<VirtualHost *:80> 
    DocumentRoot "C:/xampp/htdocs" 
    ServerName localhost 
</VirtualHost> 

<VirtualHost *:80> 
    ServerAdmin [email protected] 
    DocumentRoot "C:\xampp\htdocs\Projekte\GamePlay_dev" 
    ServerName gameplay.localhost 
    ServerAlias www.gameplay.localhost 
</VirtualHost> 

HOSTS:

127.0.0.1  localhost 
127.0.0.1  gameplay.localhost 

是的,我已经重新启动我的服务器......我甚至重新启动整个PC,只是为了确保...

+0

我的主机文件是'#本地主机名称解析在DNS本身内处理。 #\t 127.0.0.1 localhost #\t :: 1 localhost \t 192.168.1。? www.mywebsite“即使用实际的IP地址,我保留www。 – MikeT

+0

你确实在你的hosts.conf中包含了** include conf/extra/httpd-vhosts.conf **(显然指向你的虚拟主机文件所在的位置) – MikeT

+0

是的,我包含上面提到的vhosts.conf –

回答

0

按我的意见,这里有一个工作的虚拟主机,我有: -

# 
# Virtual Hosts 
# 

<VirtualHost *:80> 
    ServerName localhost 
    DocumentRoot c:/wamp/www 
    <Directory "c:/wamp/www/"> 
     Options +Indexes +FollowSymLinks +MultiViews 
     AllowOverride All 
     Require local 
    </Directory> 
</VirtualHost> 
<VirtualHost *:80> 
    DocumentRoot "C:/wamp/mt" 
    ServerName www.mt.flnet.org 
    <Directory "C:/wamp/mt"> 
     AllowOverride All 
     Require all granted 
    </Directory> 
</VirtualHost> 
<VirtualHost *:80> 
    DocumentRoot "C:/wamp/trishandmike" 
    ServerName www.tandm.flnet.org 
    <Directory "C:/wamp/trishandmike"> 
     AllowOverride All 
     Require all granted 
    </Directory> 
</VirtualHost> 
<VirtualHost *:80> 
    DocumentRoot "C:/wamp/Judggle" 
    ServerName www.JudggleCopy.flnet.org 
    <Directory "C:/wamp/Judggle"> 
     AllowOverride All 
     Require all granted 
    </Directory> 
</VirtualHost> 
<VirtualHost *:80> 
    DocumentRoot "C:/wamp/mjt" 
    ServerName www.mjt.flnet.org 
    <Directory "C:/wamp/mjt"> 
     AllowOverride All 
     Require all granted 
    </Directory> 
</VirtualHost> 
<VirtualHost *:80> 
    DocumentRoot "C:/wamp/ShopWise" 
    ServerName www.ShopWise.flnet.org 
    <Directory "C:/wamp/ShopWise"> 
     AllowOverride All 
     Require all granted 
    </Directory> 
</VirtualHost> 

在个人电脑的局域网上我有我的主机文件如(注有些是多余的,因为我是运行两个阿帕奇一个不同的机器,并没有正确地收拾): -

# localhost name resolution is handled within DNS itself. 
# 127.0.0.1  localhost 
# ::1    localhost 
    192.168.1.2 www.trishandmike.flnet.org 
    192.168.1.2 www.AIPCStudentconnect.flnet.org 
    192.168.1.2 www.zonemike.flnet.org 
    192.168.1.2 www.tristen.flnet.org 
    192.168.1.2 www.csacalc.flnet.org 
    192.168.1.2 www.ocportal.flnet.org 
    192.168.1.2 www.flwgtest.flnet.org 
    192.168.1.2 www.judggle.flnet.org 
    192.168.1.2 www.mt.flnet.org # on 2nd box running later Apacahe etc 
    192.168.1.2 www.tandm.flnet.org # on 2nd box running later Apacahe etc 
    192.168.1.2 www.JudggleCopy.flnet.org 
    192.168.1.2 www.mjt.flnet.org 
    192.168.1.2 www.judgements.flnet.org 
    192.168.1.2 www.shopwise.flnet.org 

你确实有运行Apache的PC静态IP地址?

另一个区别是我使用WAMP。我知道提供的别名让我对WAMP的后期版本感到困扰。检查您是否指向别名文件,例如在您的主机文件中有类似Include "c:/wamp/alias/*"的内容。我想我从这里删除了一个有问题的文件。

相关问题