wamp集成环境下配置多个站点

步骤一:打开D:wampinapacheApache2.2.21conf目录下的httpd.conf文件,搜索Listen 80,在其后加上Listen 88

Xml代码 
  1. #Listen 12.34.56.78:80  
  2. Listen 80  
  3. Listen 88  

步骤二:找到Include conf/extra/httpd-vhosts.conf,将前面的#去掉

Xml代码 
  1. # Virtual hosts  
  2. Include conf/extra/httpd-vhosts.conf  

步骤三:打开同目录下的extra文件夹下的httpd-vhosts.conf,默认有两个

Xml代码 
  1. <VirtualHost *:80>  
  2.     ServerAdmin webmaster@dummy-host2.example.com  
  3.     DocumentRoot "c:/Apache2/docs/dummy-host2.example.com"  
  4.     ServerName dummy-host2.example.com  
  5.     ErrorLog "logs/dummy-host2.example.com-error.log"  
  6.     CustomLog "logs/dummy-host2.example.com-access.log" common  
  7. </VirtualHost>  

修改后面一个,将VirtualHost *:80改为VirtualHost *:88,DocumentRoot "d:/wamp/www/"改为DocumentRoot "你的网站的目录"。

如:

Xml代码 
  1. <VirtualHost *:88>  
  2.     ServerAdmin webmaster@dummy-host2.example.com  
  3.     DocumentRoot "d:/wamp/www/king"  
  4.     ServerName dummy-host2.example.com  
  5.     ErrorLog "logs/dummy-host2.example.com-error.log"  
  6.     CustomLog "logs/dummy-host2.example.com-access.log" common  
  7. </VirtualHost>  

第一个里面的DocumentRoot "d:/wamp/www/"改为80端口所在的网站目录。

注:修改前请备份好这两个文件。

原文地址:https://www.cnblogs.com/relix/p/4641042.html