撒的阿坎努斯 发表于 2015-8-22 13:39:18

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

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

[*]#Listen 12.34.56.78:80
[*]Listen 80
[*]Listen 88
  步骤二:找到Include conf/extra/httpd-vhosts.conf,将前面的#去掉

[*]# Virtual hosts
[*]Include conf/extra/httpd-vhosts.conf
  步骤三:打开同目录下的extra文件夹下的httpd-vhosts.conf,默认有两个

[*]<VirtualHost *:80>
[*]    ServerAdmin webmaster@dummy-host2.example.com
[*]    DocumentRoot "c:/Apache2/docs/dummy-host2.example.com"
[*]    ServerName dummy-host2.example.com
[*]    ErrorLog "logs/dummy-host2.example.com-error.log"
[*]    CustomLog "logs/dummy-host2.example.com-access.log" common
[*]</VirtualHost>
  修改后面一个,将VirtualHost *:80改为VirtualHost *:88,DocumentRoot "d:/wamp/www/"改为DocumentRoot "你的网站的目录"。
  如:

[*]<VirtualHost *:88>
[*]    ServerAdmin webmaster@dummy-host2.example.com
[*]    DocumentRoot "d:/wamp/www/king"
[*]    ServerName dummy-host2.example.com
[*]    ErrorLog "logs/dummy-host2.example.com-error.log"
[*]    CustomLog "logs/dummy-host2.example.com-access.log" common
[*]</VirtualHost>
  第一个里面的DocumentRoot "d:/wamp/www/"改为80端口所在的网站目录。
  注:修改前请备份好这两个文件。
页: [1]
查看完整版本: wamp集成环境下配置多个站点