apache配置虚拟主机

我的博客:www.while0.com

1.开启基于主机名的模块:

LoadModule vhost_alias_module modules/mod_vhost_alias.so

2.在配置文件中添加一下几行,一定要记得把localhost也添加进去

NameVirtualHost *:80



<VirtualHost *:80>

    ServerName localhost

    DocumentRoot "E:/wamp/www/"

</VirtualHost>



<VirtualHost *:80>

    ServerName discuz.money.com

    DocumentRoot "E:/wamp/www/discuz"

</VirtualHost>



<VirtualHost *:80>

    ServerName ucenter.money.com

    DocumentRoot "E:/wamp/www/ucenter"

</VirtualHost>



<VirtualHost *:80>

    ServerName ucenterhome.money.com

    DocumentRoot "E:/wamp/www/ucenterhome"

</VirtualHost>

<VirtualHost *:80>

    ServerName www.money.com

    DocumentRoot "E:/wamp/www/0173"

</VirtualHost>

 

你可能感兴趣的:(apache)