日期:2014-05-16  浏览次数:20969 次

Apache虚拟主机配置

1.在Apache配置文件中添加虚拟主机(如下都是必须要添加的,放到httpd.conf文件中最后就行了
???NameVirtualHost *??????????????????????????
<VirtualHost *>
????ServerAdmin xxx@gmail.com
????DocumentRoot "d:/php/www/alibaba_code/dbCenter/webroot"
????ServerName alibaba.ads.com
????ErrorLog "logs/heep.com-error.log"
????CustomLog "logs/heep.com-access.log" common

????<Directory "d:/php/www/alibaba_code/dbCenter">
????AllowOverride All
????Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
????Order allow,deny
????Allow from all
????</Directory>
</VirtualHost>
<VirtualHost *>
????ServerAdmin local@gmail.com
????DocumentRoot "d:/php/www"
????ServerName local.com
????ErrorLog "logs/heep.com-error.log"
????CustomLog "logs/heep.com-access.log" common

????<Directory "d:/php/www">
????AllowOverride All
????Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
????Order allow,deny
????Allow from all
????</Directory>
</VirtualHost>


2.需要添加host
???127.0.0.1??alibaba.ads.com
???127.0.0.1??local.com

3. 重定向的loadModule要打开:
???LoadModule rewrite_module modules/mod_rewrite.so