【问题标题】:Wampserver can't get Named Virtual hosts to workWampserver 无法让命名虚拟主机工作
【发布时间】:2011-11-21 10:34:15
【问题描述】:

使用 wampserver 我无法让命名虚拟主机工作。我已经编辑了 httpd.conf 以使用

Include conf/extra/httpd-vhosts.conf

我已将域添加到我的 system32/driver/etc/hosts 文件中。我已经编辑了 httpd-vhosts.conf 文件,除了现在 localhost 不可用之外,一切似乎都正常。我设置的域(test123.com)工作正常,点击 127.0.0.1 工作正常,但点击 localhost 挂起。错误日志中没有任何相关内容,访问日志中也没有提及。这是我编辑 httpd-vhosts.conf 的方式:

#
# Virtual Hosts
#

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

# Tells Apache to serve the default WAMP Server page to "localhost"
<VirtualHost *:80>
    ServerName localhost 
    DocumentRoot "C:/wamp/www"
    <Directory "C:/wamp/www">
        Options FollowSymLinks 
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>
    DirectoryIndex index.php 
</VirtualHost>

<VirtualHost *:80>
    ServerName test123.com
    ServerAlias *.test123
    # Folder where the files live
    DocumentRoot "D:/Projects/html/test123"
    # A few helpful settings...
    <Directory "D:/Projects/html/test123">
        Options FollowSymLinks 
        AllowOverride all
        Order allow,deny
        Allow from all
    </Directory>
    DirectoryIndex index.php
</VirtualHost>

我做错了什么?

【问题讨论】:

    标签: windows apache wampserver


    【解决方案1】:

    终于想通了。在 httpd.conf 我不得不改变

    Listen 80
    

    Listen *:80
    

    【讨论】:

      猜你喜欢
      • 2016-01-08
      • 1970-01-01
      • 2012-06-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-06
      • 2015-08-03
      相关资源
      最近更新 更多