步骤一:打开D:\wamp\bin\apache\Apache2.2.21\conf目录下的httpd.conf文件,搜索Listen 80,在其后加上Listen 88
Xml代码
- #Listen 12.34.56.78:80
- Listen 80
- Listen 88
步骤二:找到Include conf/extra/httpd-vhosts.conf,将前面的#去掉
Xml代码
- # Virtual hosts
- Include conf/extra/httpd-vhosts.conf
步骤三:打开同目录下的extra文件夹下的httpd-vhosts.conf,默认有两个
Xml代码
- <VirtualHost *:80>
- ServerAdmin [email protected]
- 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 "你的网站的目录"。
如:
Xml代码
- <VirtualHost *:88>
- ServerAdmin [email protected]
- 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端口所在的网站目录。
注:修改前请备份好这两个文件。
时间: 2024-10-24 17:27:10