搭建linux下apache web服务器 dns服务器

APACHE

apache: http://www.cnblogs.com/fnng/archive/2012/08/30/2662984.html

FAQ:

 1.configure: error: APR not found. Please read the documentation 

安装apr

2.configure: error: APR-util not found. Please read the documentation 

安装apr-util

apache configure 参数:  ./configure --prefix=/usr/local/apache2  --with-apr=/usr/local/apr  --with-apr-util=/usr/local/apr-util/  



DNS


dns相关资料: http://linux.chinaitlab.com/special/linuxdns/Index.html

配置文件说明: http://linux.chinaitlab.com/server/725027.html

ubuntu下bind9配置说明: http://wiki.ubuntu.org.cn/Bind9%E5%AE%89%E8%A3%85%E8%AE%BE%E7%BD%AE%E6%8C%87%E5%8D%97


首先安装BIND套件 

sudo apt-get install bind

这时在/etc/bind下会出现(这里跟其他的UNIX/LINUX不同,一般其他的UNIX/LINUX默认是把配置文件放

在/etc/named下,数据文件放在/var/named或/var/bind下的,而UBUNTU都一起放在这个目录下了)

db.0 db.255 db.root named.conf.local 
db.127 db.local named.conf named.conf.options 

其中named.conf为主配置文件,named.conf.local和named.conf.options这两个文件在其他的UNIX/LINUX 

系统里默认是没有的
,UBUNTU的这种想法很不错,把各个部分都分开管理;其余的部分都是默认生成的几 

个数据文件。这里需要稍微讲一下区数据文件里的几个资源记录的含义: 

SOA记录:指示该区的权威 
NS记录:列出该区的一个名字服务器 
A记录:名字到地址的映射 (也就是正向解析) 
PTR记录:地址到名字的映射 (也就是反向解析) 
CNAME:规范名字 (别名记录) 

下面开始服务配置 
缓存域名服务器设置 (Cache-only server) 
缓存域名服务器顾名思义其自身是没有域名记录的,仅仅从别的DNS上获取记录并做高速缓存。 
安装好DNS服务后,不需要任何配置,只需要把服务起起来就是缓存域名服务器了。 

sudo /etc/init.d/bind start

主DNS配置

/etc/bind/named.conf.local 中  zone"localhost" zone "127.in-addr.arpa" 就是一个最好的例子 前者是正向 后者逆向
找到他们对应的文件,copy改即可 

安装好DNS后,配置named.conf.local,如下例: 

zone "163.com" {
	type master;
	file "/etc/bind/db.163.com";
};


zone "172.in-addr.arpa" {
	type master;
	file "/etc/bind/db.172";
};

保存配置,然后再创建相对应的数据文件,如上例163.com的数据文件如下: 
;
; BIND data file for local loopback interface
;
$TTL	604800
@	IN	SOA	163.com. root.163.com. (
			      2		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL
;
@	IN	NS	163.com.
@	IN	A	172.1.1.1
WWW IN	A	172.1.1.2

 
逆向文件:
;
; BIND reverse data file for local loopback interface
;
$TTL	604800
@	IN	SOA	163.com. root.163.com. (
			      1		; Serial
			 604800		; Refresh
			  86400		; Retry
			2419200		; Expire
			 604800 )	; Negative Cache TTL
;
@	IN	NS	163.com.
1.1.1	IN PTR 163.com.
2.1.1	IN	PTR	www.163.com.

sudo /etc/init.d/bind9 restart  重启服务 
tail /var/log/syslog    看系统日志 是否成功!

正向查询:

$ nslookup 163.com 10.24.8.99
Server: 10.24.8.99
Address: 10.24.8.99#53


Name: 163.com
Address: 172.1.1.1


$ nslookup www.163.com 10.24.8.99
Server: 10.24.8.99
Address: 10.24.8.99#53


Name: www.163.com
Address: 172.1.1.2


反向查询:

$ nslookup 172.1.1.1 10.24.8.99
Server: 10.24.8.99
Address: 10.24.8.99#53

1.1.1.172.in-addr.arpa name = 163.com.


$ nslookup 172.1.1.2 10.24.8.99
Server: 10.24.8.99
Address: 10.24.8.99#53


2.1.1.172.in-addr.arpa name = www.163.com.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值