The NoteBook of EricKong

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  611 Posts :: 1 Stories :: 190 Comments :: 0 Trackbacks

/etc/httpd/conf/httpd.conf 尾部

NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /var/www/web3
ServerName www.1.com
#AddDefaultCharset UTF-8 #默认编码
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/web5
ServerName www.2.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/web2
ServerName www.3.com
</VirtualHost>

//==================
如果只用一个IP

末尾添加如下几行:
NameVirtualHost 192.168.1.110
<VirtualHost www.test.com>
ServerAdmin webmaster@test.com
DocumentRoot /var/www/html
ServerName www.test.com
</VirtualHost>
<VirtualHost www.website1.com>
ServerAdmin webmaster@website1.com
DocumentRoot /var/www/html/website1
ServerName www.website1.com
</VirtualHost>
<VirtualHost www.website2.com>
ServerAdmin webmaster@website2.com
DocumentRoot /var/www/html/website2
ServerName www.website2.com
</VirtualHost>

posted on 2013-06-22 20:19 Eric_jiang 阅读(359) 评论(0)  编辑  收藏 所属分类: CentOS

只有注册用户登录后才能发表评论。


网站导航: