Home > Backend Development > PHP Tutorial > wamp配置两个虚拟主机后,访问不正常

wamp配置两个虚拟主机后,访问不正常

WBOY
Release: 2016-06-23 14:17:30
Original
1265 people have browsed it

wamp配置多个虚拟主机后,访问不正常
配置如下:

   # ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "D:\wwwroot\nasdao"
    ServerName www.a.com
   # ServerAlias www.dummy-host.example.com
   # ErrorLog "logs/dummy-host.example.com-error.log"
   # CustomLog "logs/dummy-host.example.com-access.log" common



    DocumentRoot "D:\wwwroot\jyd\web"
    ServerName www.b.com
    ServerAlias  www.b.com
    ErrorLog "D:\wwwroot\jyd\error.log"



    DocumentRoot "D:\wwwroot\jyd\web"
    ServerName b.com
    ServerAlias b.com
    ErrorLog "D:\wwwroot\jyd\error.log"


在访问www.b.com 和去掉www直接访问b.com时候访问特别缓慢 访问www.a.com正常


回复讨论(解决方案)

试试:

    DocumentRoot "D:\wwwroot\jyd\web"
    ServerName www.b.com
    ServerAlias  b.com
    ErrorLog "D:\wwwroot\jyd\web\error.log"

试试:

    DocumentRoot "D:\wwwroot\jyd\web"
    ServerName www.b.com
    ServerAlias  b.com
    ErrorLog "D:\wwwroot\jyd\web\error.log"

问题依旧啊,解决不了


试试:

    DocumentRoot "D:\wwwroot\jyd\web"
    ServerName www.b.com
    ServerAlias  b.com
    ErrorLog "D:\wwwroot\jyd\web\error.log"

问题依旧啊,解决不了
http的响应状态码是多少

跟斜杠的方向不知道有没有关系,我看apache的都是:D:/wwwroot/jyd/web

如果ServerName是域名,而域名不知存不存在,可以改一下windows的host文件

windows/system32/drivers/etc/hosts

用记事本打开编辑就可以



试试:

    DocumentRoot "D:\wwwroot\jyd\web"
    ServerName www.b.com
    ServerAlias  b.com
    ErrorLog "D:\wwwroot\jyd\web\error.log"

问题依旧啊,解决不了
http的响应状态码是多少

网站是可以打开的,就是第二个挂载的网站打开特别慢

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template