#E:\AppServ\Apache2.2\conf\extra\httpd-vhosts.conf 文件 # # Virtual Hosts # # If you want to maintain multiple domains/hostnames on your # machine you can setup VirtualHost containers for them. Most configurations # use only name-based virtual hosts so the server doesn't need to worry about # IP addresses. This is indicated by the asterisks in the directives below. # # Please see the documentation at # <URL:http://httpd.apache.org/docs/2.2/vhosts/> # for further details before you try to setup virtual hosts. # # You may use the command line option '-S' to verify your virtual host # configuration. # # Use name-based virtual hosting. # NameVirtualHost *:80 # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for all requests that do not # match a ServerName or ServerAlias in any <VirtualHost> block. # <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "C:/Apache2.2/docs/dummy-host.x" ServerName dummy-host.x ServerAlias www.dummy-host.x ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "C:/Apache2.2/docs/dummy-host2.x" ServerName dummy-host2.x ErrorLog "logs/dummy-host2.x-error.log" CustomLog "logs/dummy-host2.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www" ServerName localhost ServerAlias localhost ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/phpStudy" ServerName study.php.com ServerAlias study.php.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/sc" ServerName sc.ecshop.com ServerAlias sc.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/mm" ServerName mm.ecshop.com ServerAlias mm.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/hecha" ServerName hecha.ecshop.com ServerAlias hecha.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/taocui" ServerName taocui.ecshop.com ServerAlias taocui.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/jiayou" ServerName jiayou.ecshop.com ServerAlias jiayou.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/zuipin" ServerName zuipin.ecshop.com ServerAlias zuipin.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/jiuxian" ServerName jiuxian.ecshop.com ServerAlias jiuxian.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/yuanshiecshop" ServerName yuanshi.ecshop.com ServerAlias yuanshi.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/meilele" ServerName meilele.ecshop.com ServerAlias meilele.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/wanbiao" ServerName wanbiao.ecshop.com ServerAlias wanbiao.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/yemaijiu" ServerName yemaijiu.ecshop.com ServerAlias yemaijiu.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/xiaomi2013" ServerName xiaomi2013.ecshop.com ServerAlias xiaomi2013.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/xiaomi2014" ServerName xiaomi2014.ecshop.com ServerAlias xiaomi2014.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/techanyoulian1" ServerName techanyoulian1.ecshop.com ServerAlias techanyoulian1.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/gw" ServerName gw.diguocms.com ServerAlias gw.diguocms.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/meileleyanse" ServerName meileleyanse.ecshop.com ServerAlias meileleyanse.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/pig" ServerName pig.com ServerAlias pig.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/neirongguanli" ServerName neirongguanli.com ServerAlias neirongguanli.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/tianmao" ServerName tianmao.ecshop.com ServerAlias tianmao.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/xiehu" ServerName xiehu.ecshop.com ServerAlias xiehu.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "E:/AppServ/www/xm" ServerName xm.ecshop.com ServerAlias xm.ecshop.com ErrorLog "logs/dummy-host.x-error.log" CustomLog "logs/dummy-host.x-access.log" common </VirtualHost>
说明:
修改 C:\Windows\System32\drivers\etc\hosts 文件
1. Apache2.2\conf\httpd.conf文件中 去掉下面前面的#号,包含 httpd-vhosts.conf文件
Include conf/extra/httpd-vhosts.conf
2. httpd-vhosts.conf 修改文件
添加如下配置
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "d:/AppServ/www"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/dummy-host.x-error.log"
CustomLog "logs/dummy-host.x-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot "d:/AppServ/www/meilele"
ServerName mymeilele.chai.com
ServerAlias mymeilele.chai.com
ErrorLog "logs/dummy-host.x-error.log"
CustomLog "logs/dummy-host.x-access.log" common
</VirtualHost>