假设你正在为域名www.huzhen.org提供服务,而你又想在同一个IP地址上增加一个名叫bbs.huzhen.org的虚拟主机,你只需在httpd.conf中加入以下内容:
# Virtual Hosts
#
<VirtualHost *:80>
ServerName www.huzhen.org
DocumentRoot E:/Develop/wamp64/www
<Directory "E:/Develop/wamp64/www/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName bbs.huzhen.org
DocumentRoot D:/mywork/
<Directory "D:/mywork/">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
#
重启服务即可