apache配置多个虚拟主机
2014-05-27 00:00
246 查看
当需要多个apapche虚拟主机时
1.打开apache--conf--httpd.com
注销DocumentRoot "D:/wamp/apache/htdocs"选项
打开Include conf/extra/httpd-vhosts.conf选项
2.然后打开httpd-vhosts.conf
添加如下内容例
<VirtualHost *:80>
DocumentRoot D:/wamp/apache/htdocs/bigparty
ServerName www.bigparty.com
<Directory D:/wamp/apache/htdocs/bigparty >
AllowOverride All
Options All
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot D:/wamp/apache/htdocs/yii/shop
ServerName www.shop.com
<Directory D:/wamp/apache/htdocs/yii/shop >
AllowOverride All
Options All
</Directory>
</VirtualHost>
注:DocumentRoot,Directory项目的地址
ServerName :虚拟网址
3.打开window--system32--drivers--etc-hosts文件
在最低下加入相应的
ServerName对应的虚拟网址
例:127.0.0.1 www.bigparty.com
127.0.0.1 www.shop.com
配置完保存后,重起apache
1.打开apache--conf--httpd.com
注销DocumentRoot "D:/wamp/apache/htdocs"选项
打开Include conf/extra/httpd-vhosts.conf选项
2.然后打开httpd-vhosts.conf
添加如下内容例
<VirtualHost *:80>
DocumentRoot D:/wamp/apache/htdocs/bigparty
ServerName www.bigparty.com
<Directory D:/wamp/apache/htdocs/bigparty >
AllowOverride All
Options All
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot D:/wamp/apache/htdocs/yii/shop
ServerName www.shop.com
<Directory D:/wamp/apache/htdocs/yii/shop >
AllowOverride All
Options All
</Directory>
</VirtualHost>
注:DocumentRoot,Directory项目的地址
ServerName :虚拟网址
3.打开window--system32--drivers--etc-hosts文件
在最低下加入相应的
ServerName对应的虚拟网址
例:127.0.0.1 www.bigparty.com
127.0.0.1 www.shop.com
配置完保存后,重起apache
相关文章推荐
- linux下Apache2.2.4 + tomcat5.5+php 一个IP配置多域名,虚拟主机
- FreeBsd6.1 apache虚拟主机配置实战
- 在apache下配置虚拟主机
- 在Apache中配置虚拟主机
- Apache更方便的配置虚拟主机
- windows2003下apache配置虚拟主机和绑定域名服务
- Apache虚拟主机的配置
- Apache 虚拟主机的配置.
- linux系统配置Apache虚拟主机实例
- 如何配置apache一个ip多域名的虚拟主机?
- apache的多站点虚拟主机配置方法
- LINUX系统apache基于IP,基于port和基于域名的三种虚拟主机的配置方法
- Apache下的虚拟主机配置方法
- apache 虚拟主机的另外一种配置
- 用apache在本机配置多个基于ip的虚拟主机
- Apache同IP不同端口虚拟主机配置。
- Apache 虚拟主机的配置[Ubuntu]
- Tomcat、Apache、IIS的配置(无虚拟主机介绍)
- linux系统配置Apache虚拟主机实例
- apache2.2.9配置虚拟主机问题