1、在conf/httpd.conf中将2个虚拟主机启动的注释符号#去掉。
2、在extra/ httpd-vhosts.conf中,先将2个NameVirtualHost,再将2个端口的指向即可。
附,httpd-vhosts.conf文件
#
# Virtual Hosts
#
# Use name-based virtual hosting.
#
NameVirtualHost *:81
NameVirtualHost *:82
#
# VirtualHost example:
# Almost any apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or Serveralias in any <VirtualHost> block.
#
<VirtualHost *:81>
ServerAdmin test@www.jb200.com
DocumentRoot D:/AppServ/www
ServerName www.jb200.com
ErrorLog D:/AppServ/www/errornongye.log
CustomLog logs/host1.jb200.com-access_log common
</VirtualHost>
<VirtualHost *:82>
ServerAdmin test@www.jb200.com
DocumentRoot D:/AppServ/www/w2
ServerName www.jb200.com
ErrorLog D:/AppServ/www/w2/errornongjiale.log
CustomLog logs/host2.jb200.com-access_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.x
DocumentRoot "C:/Apache2.2/docs/dummy-host2.x"
ServerName dummy-host2.x
ErrorLog "logs/dummy-host2.x-error.log"
CustomLog "logs/dummy-host2.x-access.log" common
</VirtualHost>