繁体   English   中英

Wampserver无法使命名虚拟主机正常工作

[英]Wampserver can't get Named Virtual hosts to work

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

Include conf/extra/httpd-vhosts.conf

我已经将该域添加到了system32 / driver / etc / hosts文件中。 我已经编辑了httpd-vhosts.conf文件,并且一切似乎都可以正常工作,除了现在本地主机不可用。 我设置的域(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>

我究竟做错了什么?

终于想通了。 在httpd.conf中,我必须进行更改

Listen 80

Listen *:80

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM