I have already configured a site, now want to change to a number of sites, according to the online method need to change the site I originally configured the relevant information? Or does httpd-vhosts.conf directly cover the site I set up in httpd.conf?
Reply content:
I have already configured a site, now want to change to a number of sites, according to the online method need to change the site I originally configured the relevant information? Or does httpd-vhosts.conf directly cover the site I set up in httpd.conf?
Adding virtual sites is just a matter of configuring httpd.conf with VirtualHost configuration.
# *:80表示监听本机所有IP(需要配置有Listen 80),星号匹配所有地址,# 因此主服务器(httpd.conf里的DocumentRoot和ServerName)将不会处理任何请求.# 注意,第一个监听80端口VirtualHost将作为default server用于处理找不到匹配的80请求
DocumentRoot "/path/to/default" ServerName localhost
DocumentRoot "/path/to/a.com" ServerName a.com
DocumentRoot "/path/to/b.com" ServerName b.com
Try to modify the Hosts file
Add: 127.0.0.1 your domain
httpd-vhosts.conf Add a VirtualHost, restart the service is good, configure the official manual is very detailed, look at the understanding, it is not good to download a WAMPSERVER3 has automatic add virtualhost tools, learn a bit also line.