Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows Wampserver可以';无法让命名的虚拟主机工作_Windows_Apache_Wampserver - Fatal编程技术网

Windows Wampserver可以';无法让命名的虚拟主机工作

Windows Wampserver可以';无法让命名的虚拟主机工作,windows,apache,wampserver,Windows,Apache,Wampserver,使用wampserver,我无法让命名的虚拟主机工作。我已经编辑了httpd.conf以使用 Include conf/extra/httpd-vhosts.conf 我已将该域添加到我的system32/driver/etc/hosts文件中。我已经编辑了httpd-vhosts.conf文件,除了现在localhost不可用之外,其他一切似乎都正常。域I设置(test123.com)工作正常,命中127.0.0.1工作正常,但命中localhost挂起。错误日志中没有相关内容,访问日志中也

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

Include conf/extra/httpd-vhosts.conf
我已将该域添加到我的system32/driver/etc/hosts文件中。我已经编辑了httpd-vhosts.conf文件,除了现在localhost不可用之外,其他一切似乎都正常。域I设置(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>
#
#虚拟主机
#
#
#使用基于名称的虚拟主机。
#
名称虚拟主机*:80
#告诉Apache将默认WAMP服务器页面提供给“localhost”
服务器名本地主机
DocumentRoot“C:/wamp/www”
选项如下符号链接
允许超越所有
命令允许,拒绝
通融
DirectoryIndex.php
ServerName test123.com
ServerAlias*.test123
#文件所在的文件夹
DocumentRoot“D:/Projects/html/test123”
#一些有用的设置。。。
选项如下符号链接
允许超越所有
命令允许,拒绝
通融
DirectoryIndex.php

我做错了什么?

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

Listen 80

Listen *:80