第一步
apache下httpd.conf文件
启用模块LoadModule vhost_alias_module modules/mod_vhost_alias.so
第二步
apache下httpd.conf文件,启用文件Virtual hosts
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot D:\wamp\www
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot D:\wamp\www\58qd.cn
ServerName localhost.58qd
</VirtualHost>
<VirtualHost *:80>
DocumentRoot D:\wamp\www\sc\dz-bbs\upload
ServerName localhost.bbs.58qd
#Directory 这段可以不写
<Directory D:\wamp\www\sc\dz-bbs\upload>
Order deny,allow
Allow from all
</Direcotry>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot D:\wamp\www\freeviicms
ServerName localhost.wx
</VirtualHost>