http://blog.chinaunix.net/u/249/showart_513987.html
昨天在linux上安装的sqlite3的数据库,再用他一行一行的写,现在终于可以用了,记下来,以后有用!
bind+sqlite+sdb+view和bind+mysql+sdb+view的安装过程差不多,前面基本是一样的,
tar -zxvf bind-9.4.2.tar.gz
再修改两个文件在bind-9.4.2/bin/named下的main.c及Makefile.in
main.c在683行加入一句sqlitedb_init();如下
/*
* Add calls to register sdb drivers here.
*/
/* xxdb_init(); */
sqlitedb_init();
在710行加入一句mysqldb_clear();如下
/*
* Add calls to unregister sdb drivers here.
*/
/* xxdb_clear(); */
sqlitedb_clear();
再修改Makefile.in,,将29-32改成如下
DBDRIVER_OBJS = sqlitedb.o
DBDRIVER_SRCS = sqlitedb.c
DBDRIVER_INCLUDES =
DBDRIVER_LIBS = -lsqlite3
编译安装:
cd bind-9.4.2
./configure --prefix=/usr/local/sqlite
make;make install
再来安装sqlite3,,当然,这个安装不安装都可以的,我在WIN上建的不行,所以转到LINUX来试试!
tar -zxvf sqlite-3.5.6.tar.gz
cd sqlite-3.5.6
make;make install
安装完后,进入/usr/local/sqlite/etc,创建cdnview
[root@localhost sqlite]# sqlite3 cdnview
SQLite version 3.5.6
Enter ".help" for instructions
sqlite> create table ecdncnc (id INTEGER PRIMARY KEY, name TEXT, ttl TEXT, rdtype TEXT, rdata TEXT);
sqlite> create table ecdntel (id INTEGER PRIMARY KEY, name TEXT, ttl TEXT, rdtype TEXT, rdata TEXT);
sqlite> .exit
插入数据的语句我就不行了,大家可以下载我配置好的cdnview
|
文件: |
cdnview.rar |
大小: |
0KB |
下载: |
下载 | |
再配置named.conf,,这个文件基本上和bind+mysql+sdb+view的一样,内容如下:
===============================akin520=====================================
key "rndc-key" {
algorithm hmac-md5;
secret "HDVBwMHNNYZcozWB0dIAjw==";
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { "rndc-key"; };
};
include "ip.conf";
view "view_cnc" {
match-clients { CNC; };
zone "." {
type hint;
file "named.root";
};
zone "0.0.127.IN-ADDR.ARPA" IN {
type master;
file "localhost.rev";
};
zone "easy-cdn.cn" IN {
type master;
notify no;
database "sqlite /usr/local/sqlite/etc/cdnview ecdncnc";
};
};
view "view_any" {
match-clients { any; };
zone "." {
type hint;
file "named.root";
};
zone "0.0.127.IN-ADDR.ARPA" IN {
type master;
file "localhost.rev";
};
zone "easy-cdn.cn" IN {
type master;
notify no;
database "sqlite /usr/local/sqlite/etc/cdnview ecdntel";
};
};
====================================akin520==================================
运行系统:
[root@localhost sbin]# ./named -g
26-Mar-2008 01:41:23.079 starting BIND 9.4.2 -g
26-Mar-2008 01:41:23.090 loading configuration from '/usr/local/sqlite/etc/named.conf'
26-Mar-2008 01:41:23.095 listening on IPv4 interface lo, 127.0.0.1#53
26-Mar-2008 01:41:23.100 listening on IPv4 interface eth0, 192.168.1.241#53
26-Mar-2008 01:41:23.127 automatic empty zone: view view_cnc: 127.IN-ADDR.ARPA
26-Mar-2008 01:41:23.129 automatic empty zone: view view_cnc: 254.169.IN-ADDR.ARPA
26-Mar-2008 01:41:23.130 automatic empty zone: view view_cnc: 2.0.192.IN-ADDR.ARPA
26-Mar-2008 01:41:23.131 automatic empty zone: view view_cnc: 255.255.255.255.IN-ADDR.ARPA
26-Mar-2008
01:41:23.132 automatic empty zone: view view_cnc:
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA
26-Mar-2008
01:41:23.133 automatic empty zone: view view_cnc:
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA
26-Mar-2008 01:41:23.134 automatic empty zone: view view_cnc: D.F.IP6.ARPA
26-Mar-2008 01:41:23.135 automatic empty zone: view view_cnc: 8.E.F.IP6.ARPA
26-Mar-2008 01:41:23.135 automatic empty zone: view view_cnc: 9.E.F.IP6.ARPA
26-Mar-2008 01:41:23.136 automatic empty zone: view view_cnc: A.E.F.IP6.ARPA
26-Mar-2008 01:41:23.137 automatic empty zone: view view_cnc: B.E.F.IP6.ARPA
26-Mar-2008 01:41:23.154 automatic empty zone: view view_any: 127.IN-ADDR.ARPA
26-Mar-2008 01:41:23.155 automatic empty zone: view view_any: 254.169.IN-ADDR.ARPA
26-Mar-2008 01:41:23.156 automatic empty zone: view view_any: 2.0.192.IN-ADDR.ARPA
26-Mar-2008 01:41:23.157 automatic empty zone: view view_any: 255.255.255.255.IN-ADDR.ARPA
26-Mar-2008
01:41:23.157 automatic empty zone: view view_any:
0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA
26-Mar-2008
01:41:23.159 automatic empty zone: view view_any:
1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA
26-Mar-2008 01:41:23.160 automatic empty zone: view view_any: D.F.IP6.ARPA
26-Mar-2008 01:41:23.160 automatic empty zone: view view_any: 8.E.F.IP6.ARPA
26-Mar-2008 01:41:23.161 automatic empty zone: view view_any: 9.E.F.IP6.ARPA
26-Mar-2008 01:41:23.162 automatic empty zone: view view_any: A.E.F.IP6.ARPA
26-Mar-2008 01:41:23.163 automatic empty zone: view view_any: B.E.F.IP6.ARPA
26-Mar-2008 01:41:23.196 command channel listening on 127.0.0.1#953
26-Mar-2008 01:41:23.198 ignoring config file logging statement due to -g option
26-Mar-2008 01:41:23.205 zone 0.0.127.IN-ADDR.ARPA/IN/view_cnc: loaded serial 1997022700
26-Mar-2008 01:41:23.214 zone 0.0.127.IN-ADDR.ARPA/IN/view_any: loaded serial 1997022700
26-Mar-2008 01:41:23.218 running
运行OK,,如果出错下面的错误是soa.ns没配置好,
26-Mar-2008 01:40:34.637 zone 0.0.127.IN-ADDR.ARPA/IN/view_cnc: loaded serial 1997022700
26-Mar-2008 01:40:34.643 zone easy-cdn.cn/IN/view_cnc: could not find NS and/or SOA records
26-Mar-2008 01:40:34.643 zone easy-cdn.cn/IN/view_cnc: has 0 SOA records
26-Mar-2008 01:40:34.644 zone easy-cdn.cn/IN/view_cnc: has no NS records
26-Mar-2008 01:40:34.647 zone 0.0.127.IN-ADDR.ARPA/IN/view_any: loaded serial 1997022700
26-Mar-2008 01:40:34.650 zone easy-cdn.cn/IN/view_any: could not find NS and/or SOA records
26-Mar-2008 01:40:34.651 zone easy-cdn.cn/IN/view_any: has 0 SOA records
26-Mar-2008 01:40:34.651 zone easy-cdn.cn/IN/view_any: has no NS records
26-Mar-2008 01:40:34.654 running
结束!
阅读(1428) | 评论(0) | 转发(0) |