Home > Backend Development > PHP Tutorial > wampserver vhost问题

wampserver vhost问题

WBOY
Release: 2016-06-23 13:55:46
Original
968 people have browsed it


httpd-vhosts.conf文件


    DocumentRoot "D:\wamp\www"
    ServerName  a.com



    DocumentRoot "D:\wamp\www\yiqu"
    ServerName  b.com 

写了
hosts
127.0.0.1 a.com
127.0.0.1 b.com
为什么访问 a.com还是打不开


回复讨论(解决方案)

httpd.conf 中的 Include conf/extra/httpd-vhosts.conf 去掉注释了吗?

httpd-vhosts.conf文件


    DocumentRoot "D:\wamp\www"
    ServerName  a.com



    DocumentRoot "D:\wamp\www\yiqu"
    ServerName  b.com 

写了
hosts
127.0.0.1 a.com
127.0.0.1 b.com
为什么访问 a.com还是打不开


直接写在apache的httpd.conf
或者写在httpd-vhosts.conf,但是要注释掉httpd.conf里面加载httpd-vhosts.conf的#号



httpd-vhosts.conf文件


    DocumentRoot "D:\wamp\www"
    ServerName  a.com



    DocumentRoot "D:\wamp\www\yiqu"
    ServerName  b.com 

写了
hosts
127.0.0.1 a.com
127.0.0.1 b.com
为什么访问 a.com还是打不开


直接写在apache的httpd.conf
或者写在httpd-vhosts.conf,但是要注释掉httpd.conf里面加载httpd-vhosts.conf的#号 或者写在httpd-vhosts.conf,但是要注释掉httpd.conf里面加载httpd-vhosts.conf的#号 我是这样做的哈

在httpd.conf中的还有几处AllowOverride None需要改成AllowOverride All 

Related labels:
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