Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7612037
  • 博文数量: 1769
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16352
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1769)

文章存档

2024年(15)

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: LINUX

2008-04-01 16:44:45

昨天在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
 
结束!
阅读(1625) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2009-08-29 16:09:58

再来安装sqlite3,,当然,这个安装不安装都可以的,我在WIN上建的不行,所以转到LINUX来试试! tar -zxvf sqlite-3.5.6.tar.gz cd sqlite-3.5.6 make;make install 这个流程上有错误吧,bind是基于sqlite编译的,而你再后编译sqlite? 幸亏你的操作系统之前已经缺省安装了sqlite

chinaunix网友2009-08-29 16:01:59

ib/bind9/include -I/opt/bind-9.4.2/lib/isccfg/include -I../../lib/isccfg/include -I/opt/bind-9.4.2/lib/isccc/include -I../../lib/isccc/include -I/opt/bind-9.4.2/lib/isc/include -I../../lib/isc -I../../lib/isc/include -I../../lib/isc/unix/include -I../../lib/isc/nothreads/include -I../../lib/isc/x86_32/include -lsqlite3 -g -O2 -W -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wformat -Wpointer-arith -fno-strict-aliasing -c lwdnoop.c gcc: -lsqlite3: linker input file unused becaus