设为首页收藏本站language 语言切换

鸿鹄论坛

 找回密码
 论坛注册

QQ登录

先注册再绑定QQ

查看: 2053|回复: 2
收起左侧

RedHat9.0下的DNS和虚拟主机的配置

[复制链接]
发表于 2010-9-20 11:31:55 | 显示全部楼层 |阅读模式
配置几个简单的虚拟主机,DNS 服务器IP为169.254.1.189例我公司的域名为:stcore.com.我想配置以下几个服务器为:

  ftp.stcore.com,mail.stcore.com,kuanping.stcore.com,soft.stcore.com,

  xiaoshou.zzvcom.com,cpzz.zzvcom.com,net.zzvcom.com,yanfa.zzvcom.com.


先安装RPM域名解析软件named,再下载apache.tar.gz

  #tar –zxvf apache.tar.gz

  #cd apache

  #./configure –prefix=/usr/local/apache

  #make;make install;make clean

  #vi /usr/local/apache/conf/httpd.conf

  ServerName 169.254.1.189

  NameVirtualHost 169.254.1.189

  <VirtualHost 169.254.1.189>

  ServerName ftp.stcore.com

  DocumentRoot /www/ftp

  TransferLog logs/ftp_access_log

  </VirtualHost>

  <VirtualHost 169.254.1.189>

  ServerName mail.zzvcom.com

  DocumentRoot /www/mail

  TransferLog logs/mail_access_log

  </VirtualHost>

  <VirtualHost 169.254.1.189>

  ServerName kuanping.zzvcom.com

  DocumentRoot /www/kuanping

  TransferLog logs/kuanping_access_log

  </VirtualHost>

  <VirtualHost 169.254.1.189>

  ServerName soft.zzvcom.com

  DocumentRoot /www/soft

  TransferLog logs/soft_access_log

  </VirtualHost>

  <VirtualHost 169.254.1.189>

  ServerName xiaoshou.zzvcom.com

  DocumentRoot /www/xiaoshou

  TransferLog logs/xiaoshou_access_log

  </VirtualHost>

  <VirtualHost 169.254.1.189>

  ServerName cpzz.zzvcom.com

  DocumentRoot /www/cpzz

  TransferLog logs/cpzz_access_log

  </VirtualHost>

  <VirtualHost 169.254.1.189>

  ServerName net.zzvcom.com

  DocumentRoot /www/net

  TransferLog logs/net_access_log

  </VirtualHost>

  <VirtualHost 169.254.1.189>

  ServerName yanfa.zzvcom.com

  DocumentRoot /www/yanfa

  TransferLog logs/yanfa_access_log

  </VirtualHost>

  #mkdir /www

  #cd /www

  #mkdir ftp mail soft xiaoshou net yanfa cpzz kuanping


分别在/www/ftp /www/mail /www/soft /www/xiaoshou /www/net

/www/yanfa /www/kuanping /www/cpzz目录下放一个各自的主页(index.html),并将其属性设为755。

  #/usr/local/apache/bin/apachectl configtest

  #/usr/local/apache/bin/httpd -S
若一切都OK,就可以运行以下命令(启动apache)

  #/usr/local/apache/bin/apachectl start

  #vi /etc/named.conf


在尾部加上如下几行:

  zone "1.254.169.in-addr.arpa" in {

  type master;

  file "db.1.254.169";

  allow-update { none; };

  };

  zone "stcore.com" {

  type master;

  file "stcore.coms";

  allow-update { none; };
  };

  #vi /var/named/db.1.254.169

  @ IN SOA localhost. root.localhost. (

  1997022700 ; Serial

  28800 ; Refresh

  14400 ; Retry

  3600000 ; Expire

  86400 ) ; Minimum

  IN NS localhost.

  1 IN PTR localhost.

  189 IN PTR ftp.stcore.com

  #vi /var/named/zzvcom.coms

  @ IN SOA dns.stcore.com. root.stcore.com. (

  947579188 ; Serial Number

  10800 ; Refresh after 3 hours

  3600 ; Retry after 1 hour

  604800 ; Expire after 1 week

  86400 ) ; Minimum TTL of 1 day

  @ IN NS dns.zzvcom.com.

  localhost IN A 127.0.0.1

  ftp IN A 169.254.1.189

  mail IN CNAME ftp

  kuanping IN CNAME ftp

  xiaoshou IN CNAME ftp

  net IN CNAME ftp

  soft IN CNAME ftp

  yanfa IN CNAME ftp

  cpzz IN CNAME ftp

  #vi /etc/resolv.conf

  domain zzvcom.com

  nameserver 169.254.1.189

  #/etc/rc.d/init.d/named start


    用nslookup检验一下DNS的正确性。在我们客户端(WINDOWS下)设置DNS为169.254.1.189(只要这一个,因为我们的DNS服务器还不是一个公网IP,且没有申请为DNS服务器)。在IE里打开这个网址 ftp.stcore.com soft.stcore.com 若正确,所有实验就成功了。
发表于 2013-5-7 13:49:33 | 显示全部楼层
谢谢,O(∩_∩)O哈哈~
沙发 2013-5-7 13:49:33 回复 收起回复
回复 支持 反对

使用道具 举报

发表于 2013-5-24 07:48:13 | 显示全部楼层
板凳 2013-5-24 07:48:13 回复 收起回复
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 论坛注册

本版积分规则

QQ|Archiver|手机版|小黑屋|sitemap|鸿鹄论坛 ( 京ICP备14027439号 )  

GMT+8, 2025-1-27 12:16 , Processed in 0.053606 second(s), 10 queries , Redis On.  

  Powered by Discuz!

  © 2001-2025 HH010.COM

快速回复 返回顶部 返回列表