lost and found ( for me ? )

build BIND10 and run BIND10 as a recursive name server on CentOS6.4 64bit


Here’s trial and error logs when building BIND10 on CentOS6 64bit



[ compile BIND10 including a lot of trial and error logs .. ]


[root@centos6-1 ~]# cat /etc/redhat-release
CentOS release 6.4 (Final)

[root@centos6-1 ~]# uname -ri
2.6.32-358.2.1.el6.x86_64 x86_64

download bind10 from www.isc.org
I downloaded bind10-1.0.0.tar.gz.

before compiling BIND10 , install gcc c++.
# yum install -y gcc-c++.x86_64

# tar xzvf bind10-1.0.0.tar.gz
# cd bind10-1.0.0

# ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
<snip>
checking whether __clang__ is declared... no
checking whether -Wl,-R flag is available in linker... yes
checking whether g++ supports -Wno-missing-field-initializers... yes
checking for in-TU anonymous namespace breakage... no
checking for a Python interpreter with version >= 3.1... none
configure: error: no suitable Python interpreter found

nn , python 3.1 or later is required ..
# python --version
Python 2.6.6

install python 3.3.1.

# bunzip2 Python-3.3.1.tar.bz2
# tar xvf Python-3.3.1.tar
# cd Python-3.3.1

install python3 under /usr/local/python3 directory.
1113  mkdir /usr/local/python3
1114  ./configure --prefix /usr/local/python3
1115  make
1116  make install

# /usr/local/python3/bin/python3 --version
Python 3.3.1

build bind10 again.
# ./configure --with-pythonpath=/usr/local/python3/bin/python3.3
<snip>
checking for pkg-config... /usr/bin/pkg-config
checking usability of pkg-config botan-1.10 --silence-errors... not usable
checking usability of pkg-config botan-1.9 --silence-errors... not usable
checking usability of pkg-config botan-1.8 --silence-errors... not usable
checking botan/botan.h usability... no
checking botan/botan.h presence... no
checking for botan/botan.h... no
configure: error: Missing required header files.

error..

install botan.h which includes botan-devel.
# rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# yum install botan botan-devel –y

try again. error
# ./configure --with-pythonpath=/usr/local/python3/bin/python3.3
<snip>
checking log4cplus/logger.h usability... no
checking log4cplus/logger.h presence... no
checking for log4cplus/logger.h... no
configure: error: Missing required header files.
install log4cplus-devel
# yum isntall log4cplus-devel -y

error
# ./configure --with-pythonpath=/usr/local/python3/bin/python3.3
checking boost/shared_ptr.hpp usability... no
checking boost/shared_ptr.hpp presence... no
checking for boost/shared_ptr.hpp... no
configure: error: Missing required header files.

# yum install -y boost-devel

# ./configure --with-pythonpath=/usr/local/python3/bin/python3.3
<snip>
checking for SQLITE... no
configure: error: Package requirements (sqlite3 >= 3.3.9) were not met:

No package 'sqlite3' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables SQLITE_CFLAGS
and SQLITE_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

[root@centos6-1 bind10-1.0.0]# which sqlite3
/usr/bin/sqlite3
[root@centos6-1 bind10-1.0.0]# sqlite3 --version
3.6.20

# yum install sqlite-devel -y

okay.
# ./configure --with-pythonpath=/usr/local/python3/bin/python3.3
<snip>
  BIND 10 source configure results:
   -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Package:
 Name:          bind10
 Version:       1.0.0

C++ Compiler:    g++

Flags:
 DEFS:          -DHAVE_CONFIG_H
 CPPFLAGS:       -DOS_LINUX  -I$(top_srcdir)/ext/asio -I$(top_srcdir)/ext/coroutine -DASIO_DISABLE_THREADS=1
 CXXFLAGS:      -g -O2
 LDFLAGS:        -Wl,-R/usr/lib
 B10_CXXFLAGS:   -Wall -Wextra -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -Werror -fPIC
 OS Family:     Linux
 Python:        -I/usr/local/python3/include/python3.3m -I/usr/local/python3/include/python3.3m

                 -L/usr/local/python3/lib/python3.3/config-3.3m  -Wl,-R/usr/local/python3/lib/python3.3/config-3.3m

 Boost:
 Botan:         -I/usr/include
                 -L/usr/lib
                -L/usr/lib -lbotan -lbz2 -lcrypto -lgmp -lpthread -lrt -lz  -lbotan -lbz2 -lcrypto -lgmp -lpthread -lrt -lz
 Log4cplus:
                 -llog4cplus -pthread
 SQLite:
                -lsqlite3

# make
# make install

start bind10.. error
# /usr/local/sbin/bind10
Traceback (most recent call last):
 File "/usr/local/libexec/bind10/b10-init", line 71, in <module>
   import isc.cc
 File "/usr/local/lib/python3.3/site-packages/isc/__init__.py", line 7, in <module>
   import isc.datasrc
 File "/usr/local/lib/python3.3/site-packages/isc/datasrc/__init__.py", line 33, in <module>
   from isc.datasrc.sqlite3_ds import *
 File "/usr/local/lib/python3.3/site-packages/isc/datasrc/sqlite3_ds.py", line 16, in <module>
   import sqlite3, re, random
 File "/usr/local/python3/lib/python3.3/sqlite3/__init__.py", line 23, in <module>
   from sqlite3.dbapi2 import *
 File "/usr/local/python3/lib/python3.3/sqlite3/dbapi2.py", line 26, in <module>
   from _sqlite3 import *
ImportError: No module named '_sqlite3'

nn , I guess the problem is ,, there is no sqlite3 module for Python3.3.
# /usr/local/python3/bin/python3.3
Python 3.3.1 (default, Apr 17 2013, 18:34:41)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/usr/local/python3/lib/python3.3/sqlite3/__init__.py", line 23, in <module>
   from sqlite3.dbapi2 import *
 File "/usr/local/python3/lib/python3.3/sqlite3/dbapi2.py", line 26, in <module>
   from _sqlite3 import *
ImportError: No module named '_sqlite3'

nnn , build Python 3.3 again
before bulding python 3.3 , it seems that I need to install the following packages to use sqlite3 module.
# yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel –y

# cd Python-3.3.1
# ./configure --prefix /usr/local/python3;make ;make install

okay.
# /usr/local/python3/bin/python3.3
Python 3.3.1 (default, Apr 17 2013, 19:31:51)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>>

start bind10.
# /usr/local/sbin/bind10
2013-04-17 22:34:27.949 INFO  [b10-cfgmgr.cfgmgr/21176] CFGMGR_CONFIG_FILE Configuration manager starting with configuration file: /usr/local/var/bind10/b10-config.db
2013-04-17 22:34:28.890 INFO  [b10-init.init/21172] BIND10_STARTING starting BIND10: bind10 20110223 (BIND 10 1.0.0)
2013-04-17 22:34:28.890 INFO  [b10-init.init/21172] BIND10_CONFIGURATOR_START bind10 component configurator is starting up
2013-04-17 22:34:28.890 INFO  [b10-init.init/21172] BIND10_COMPONENT_START component Socket creator is starting
2013-04-17 22:34:28.890 INFO  [b10-init.init/21172] BIND10_SOCKCREATOR_INIT initializing socket creator parser
2013-04-17 22:34:28.890 INFO  [b10-init.init/21172] BIND10_COMPONENT_START component msgq is starting
2013-04-17 22:34:28.890 INFO  [b10-init.init/21172] BIND10_STARTING_PROCESS starting process b10-msgq
2013-04-17 22:34:28.890 INFO  [b10-init.init/21172] BIND10_COMPONENT_START component cfgmgr is starting
2013-04-17 22:34:28.890 INFO  [b10-init.init/21172] BIND10_STARTING_PROCESS starting process b10-cfgmgr
2013-04-17 22:34:28.890 INFO  [b10-init.init/21172] BIND10_STARTING_CC starting configuration/command session
2013-04-17 22:34:28.895 INFO  [b10-init.init/21172] BIND10_READING_INIT_CONFIGURATION reading b10-init configuration
2013-04-17 22:34:28.895 INFO  [b10-init.init/21172] BIND10_CONFIGURATOR_RECONFIGURE reconfiguring running components
2013-04-17 22:34:28.895 INFO  [b10-init.init/21172] BIND10_COMPONENT_START component b10-cmdctl is starting
2013-04-17 22:34:28.895 INFO  [b10-init.init/21172] BIND10_STARTING_PROCESS starting process b10-cmdctl
2013-04-17 22:34:28.897 INFO  [b10-init.init/21172] BIND10_COMPONENT_START component b10-stats is starting
2013-04-17 22:34:28.897 INFO  [b10-init.init/21172] BIND10_STARTING_PROCESS starting process b10-stats
2013-04-17 22:34:28.902 INFO  [b10-init.init/21172] BIND10_STARTUP_COMPLETE BIND 10 started
2013-04-17 22:34:28.975 INFO  [b10-stats.stats/21179] STATS_STARTING starting

create a user
please note that you need to issue “b10-cmdctl-usermgr” command after moving to /usr/local/etc/bind10 directory.
# cd /usr/local/etc/bind10/

# ls
cmdctl-certfile.pem  cmdctl-keyfile.pem

# which b10-cmdctl-usermgr
/usr/local/sbin/b10-cmdctl-usermgr

# /usr/local/sbin/b10-cmdctl-usermgr
Desired Login Name:hello
Choose a password:
Re-enter password:

create new account successfully!

continue to create new account by input 'y' or 'Y':


# ls
cmdctl-accounts.csv  cmdctl-certfile.pem  cmdctl-keyfile.pem

configure bind10 as a recursive server.
# bindctl
No stored password file found, please see sections "Configuration specification for b10-cmdctl" and "bindctl command-line options" of the BIND 10 guide.
Username: hello
Password:
["login success "]
> config add Init/components b10-resolver
> config set Init/components/b10-resolver/special resolver
> config set Init/components/b10-resolver/kind needed
> config set Init/components/b10-resolver/priority 10
> config commit
>

syslog
2013-04-17 22:57:39.029 INFO  [b10-init.init/21415] BIND10_COMPONENT_START component b10-resolver is starting
2013-04-17 22:57:39.029 INFO  [b10-init.init/21415] BIND10_STARTING_PROCESS starting process b10-resolver
2013-04-17 22:57:39.049 INFO  [b10-resolver.resolver/21554] RESOLVER_STARTING starting resolver with command line 'b10-resolver'
2013-04-17 22:57:39.049 INFO  [b10-resolver.resolver/21554] RESOLVER_RECURSIVE running in recursive mode
2013-04-17 22:57:39.049 WARN  [b10-resolver.resolver/21554] RESOLVER_NO_ROOT_ADDRESS no root addresses available
2013-04-17 22:57:39.049 INFO  [b10-resolver.resolver/21554] RESOLVER_SET_QUERY_ACL query ACL is configured
2013-04-17 22:57:39.060 INFO  [b10-init.init/21415] BIND10_SOCKET_GET requesting socket [::1]:53 of type TCP from the creator
2013-04-17 22:57:39.060 INFO  [b10-init.init/21415] BIND10_SOCKET_CREATED successfully created socket 21
2013-04-17 22:57:39.062 INFO  [b10-init.init/21415] BIND10_SOCKET_GET requesting socket [::1]:53 of type UDP from the creator
2013-04-17 22:57:39.066 INFO  [b10-init.init/21415] BIND10_SOCKET_CREATED successfully created socket 23
2013-04-17 22:57:39.067 INFO  [b10-init.init/21415] BIND10_SOCKET_GET requesting socket [127.0.0.1]:53 of type TCP from the creator
2013-04-17 22:57:39.067 INFO  [b10-init.init/21415] BIND10_SOCKET_CREATED successfully created socket 24
2013-04-17 22:57:39.068 INFO  [b10-init.init/21415] BIND10_SOCKET_GET requesting socket [127.0.0.1]:53 of type UDP from the creator
2013-04-17 22:57:39.068 INFO  [b10-init.init/21415] BIND10_SOCKET_CREATED successfully created socket 25
2013-04-17 22:57:39.069 INFO  [b10-resolver.resolver/21554] RESOLVER_STARTED resolver started

[root@centos6-1 ~]# lsof -ni:53
COMMAND     PID USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
b10-init  21415 root   21u  IPv6 2413342      0t0  TCP [::1]:domain (LISTEN)
b10-init  21415 root   23u  IPv6 2413347      0t0  UDP [::1]:domain
b10-init  21415 root   24u  IPv4 2413349      0t0  TCP 127.0.0.1:domain (LISTEN)
b10-init  21415 root   25u  IPv4 2413352      0t0  UDP 127.0.0.1:domain
b10-resol 21554 root   13u  IPv6 2413342      0t0  TCP [::1]:domain (LISTEN)
b10-resol 21554 root   14u  IPv6 2413347      0t0  UDP [::1]:domain
b10-resol 21554 root   15w  IPv4 2413349      0t0  TCP 127.0.0.1:domain (LISTEN)
b10-resol 21554 root   16u  IPv4 2413352      0t0  UDP 127.0.0.1:domain

[root@centos6-1 ~]# dig @127.0.0.1 www.google.com +short
74.125.235.147
74.125.235.145
74.125.235.144
74.125.235.148
74.125.235.146

stop bind10
# bindctl
["login success "] login as hello
> Init shutdown
> quit
Failed to send request, the connection is closed

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.