本文转载自:
http://hi.baidu.com/zzz1020/item/3606432df6e84498b632635f
假设我们要绑定的域名是yoxixi.com,二级域名是bbs.yoxixi.com,独立IP为192.168.1.1
绑定多个域名
打开http.conf,用过查找的方法来搜索:
1.ServerName 127.0.0.1修改成ServerName 192.168.1.1
2.#NameVirtualHost * 修改成NameVirtualHost 192.168.1.1"
3.拉到文件最底部,有虚拟主机格式:
#<VirtualHost *>
# ServerAdmin
# DocumentRoot /www/httpd/html/minidx.com
# ServerName minidx.com
# ErrorLog logs/minidx.com-error_log
# CustomLog logs/minidx.com-access_log common
#</VirtualHost>
简单的添加:
<VirtualHost 192.168.1.1>
DocumentRoot usr/local/www/
ServerName 192.168.1.1
</VirtualHost>
<VirtualHost192.168.1.1>
DocumentRoot usr/local/www/yoxixi/
ServerName yoxixi.com
</VirtualHost>
<VirtualHost 192.168.1.1>
DocumentRoot usr/local/www/yoxixi/bbs
ServerName bbs.yoxixi.com
</VirtualHost>
本文转载自:
http://hi.baidu.com/zzz1020/item/3606432df6e84498b632635f