
| 标签:apache 配置 | 分类:apache |
在window服务器中给apache服务器增加多个站点(不同的站点放在同一台服务器上),只要修改apache配置文件,在后面增加相应的内容
假如要在apache服务器上增加两个站点:www.test.com、www.test2.com,我们只要在apache配置文件(/Apache2.2/conf/httpd.conf)后增加以下内容:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /www/test
ServerName www.test.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /www/test2
ServerName www.test2.com
</VirtualHost>
注:/www/test、/www/test2为两个网站对应的路径,且基路径必须在配置文件DocumentRoot \"\"与<Directory \"\">所设的路径下