• 关于apache虚拟机的NameVirtualHost错误


    配置apache的虚拟机,设置不同的域名访问路径

    <VirtualHost 127.0.0.1:80>
    DocumentRoot     D:\wamp\www\comic\trunk\comic
    ServerName     comic127.178.com
    ......
    </VirtualHost>
    
    
    <VirtualHost 127.0.0.1:80>
    DocumentRoot    "D:\wamp\www\comic\trunk\comic\mh"
    ServerName     manhua127.178.com
    ......
    </VirtualHost>

    运行后进行访问,发现全部都指向第一个设置的 D:\wamp\www\comic\trunk\comic 路径下

    查看 apache_error.log 文件,发现下面的错误警告:

    [Fri Aug 03 14:05:56 2012] [warn] VirtualHost 127.0.0.1:80 overlaps with VirtualHost 127.0.0.1:80, the first has precedence, perhaps you need a NameVirtualHost directive

    解决方法:

    添加 NameVirtualHost ,代码如下

    NameVirtualHost 127.0.0.1
    <VirtualHost 127.0.0.1:80> DocumentRoot D:\wamp\www\comic\trunk\comic ServerName comic127.178.com ...... </VirtualHost> <VirtualHost 127.0.0.1:80> DocumentRoot "D:\wamp\www\comic\trunk\comic\mh" ServerName manhua127.178.com ...... </VirtualHost>

    保存重启apache,再访问,成功.

  • 相关阅读:
    接口内容小结
    接口的静态方法与私有方法
    接口的默认方法
    发红包O
    抽象
    《大道至简》读后感
    重写
    继承中的二义性问题
    数学应用
    继承
  • 原文地址:https://www.cnblogs.com/caly/p/2621581.html
Copyright © 2020-2023  润新知