apache多域名绑定教程

四月 17, 2010 by · Leave a Comment 

用记事本打开appache下面的httpd.conf文件

示例如下:
#NameVirtualHost *:80

#
# VirtualHost example:
# Almost any directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#


#
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#

#号是起注释作用的
实例
NameVirtualHost 203.171.228.123:80

//ip及端口
ServerAdmin webmaster@r9sky.com //管理邮箱地址
DocumentRoot E:asd //绑定的目录
ServerName www.r9sky.com //绑定的域名
ErrorLog logs/pds-error_log //错误的日志
CustomLog logs/pds_log common //客户日志
ServerAdmin kingseo@163.com
DocumentRoot E:asdabc
ServerName vps.r9sky.com
ErrorLog logs/r9sky.com-error_log
CustomLog logs/r9sky.com-access_log common
ServerAdmin kingseo@163.com
DocumentRoot E:asdabca
ServerName a.r9sky.com
ErrorLog logs/a-error_log
CustomLog logs/a_log common

要绑定多少个域名,就添加多少个记录。

About admin

注意:

1、本站启用了审核机制,你的留言可能稍后才会显示,请不要重复提交,谢谢。
2、留言时的头像是Gravatar提供的服务。想设置的看这里
3、评论者允许使用'@user空格'的方式将自己的评论通知另外评论者。

To submit your comment, click the image below where it asks you to...
Clickcha - The One-Click Captcha