centos apache 基于域名的虚拟主机

来源:互联网 发布:安全联盟软件 编辑:程序博客网 时间:2024/05/16 14:13

基于域名的虚拟主机

NameVirtualHost 192.168.0.94:
<VirtualHost www.web1.com>
ServerName www.web1.com:80
DocumentRoot /var/www/web1
DirectoryIndex index.html index.htm
</VirtualHost>
<VirtualHost www.web2.com>
ServerName www.web2.com:80
DocumentRoot /var/www/web2
DirectoryIndex index.html index.htm
</VirtualHost>

然后大家在,linux下的/etc/hosts文件或者windows下C:/WINNT/system32/drivers/etc/hosts文件中,加入
192.168.0.94 www.web1.com
192.168.0.94 www.web2.com

0 0
原创粉丝点击