zcl_ccc 发表于 2015-8-22 13:05:41

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前面加上#号注释掉。
  然后配置上自己的域名,事例格式如下图:
  
  
页: [1]
查看完整版本: wamp 配置多个域名(设置多个根目录)