wamp 配置多个域名(设置多个根目录)

第一步:找到httpd.conf 文件 

 

找到这一句:#Include conf/extra/httpd-vhosts.conf  ,去掉前面的#,开启虚拟主机功能。

 

第二步:在extra 下找到httpd-vhosts.conf    

   

按照如下方式配置  <VirtualHost *:80>  
                         DocumentRoot "c:\wamp\www\skyeyes"  
                        ServerName 
www.skyeyes.com
                        </VirtualHost>
                       <VirtualHost *:80>  
                        DocumentRoot "c:\wamp\www\other"  
                        ServerName 
www.other.com
                      </VirtualHost>

其中 ServerName 是域名  DocumentRoot 是根目录

要保证你的c:\wamp\www 目录下有skyeyes 和other 两个文件夹。

 

第三步: 修改hosts文件 文件目录示例如下 :   

 

 

将原来的127.0.0.1 localhost  前面加上#号注释掉。 

然后配置上自己的域名,事例格式如下图:

 

posted @ 2015-07-31 12:31  co喵儿  阅读(581)  评论(0编辑  收藏  举报