Finally completed the compilation and installation of BIND9 + MYSQL-BIND

xiaoxiao2021-03-05  23

From last night to now, constipation, and finally compiled, but some options have been removed, do not know if there is any problem.

Chinese reference http://blog.chinaunix.net/Article.php?articleid=6314&blogid=406

Install Bind from the source code, load MySQL support 1 download Bind source code package, and mysql-bind package 2 decompress two packages, copy mysqldb.c and mysqldb.h in mysql-bind to bind9 / bin / named / include and bind9 / bin / named directory. 3 vi bind9 / bin / named / makefile.in; Sets DBDriver_srcs, driver_objs, dbdriver_includes, dbdriver_libs, etc. . the mysql_config --cflags mysql_config --libs and output is provided such as I: DBDRIVER_OBJS = mysqldb.oDBDRIVER_SRCS = mysqldb.cDBDRIVER_INCLUDES = -I '/ usr / local / mysql / include' DBDRIVER_LIBS = -L '/ usr / local / mysql / lib '-LMYSQLCLIENT -LZ -LCRYPT -LNSL -LM -LC -LNSS_FILES -LNSS_DNS -LRESOLV followed by vi bind9 / bin / named / main.c, add #include "mysqldb.h" in the header file. and then Call to ns_server_create () Add mysqldb_init (); add mysqldb_clean () before ns_server_Destroy (). 4 Enter bind9 directory, ./configure, make, make install installation BIND9.5 Create Link ln -s / usr / local / sbin / rNDC / usr / sbin / rndc ln -s / usr / local / sbin / named / usr / sbin / named 6 Create an RDC.CONF configuration file. / usr / local / sbin / rndc-confgen> /etc/rndc.conf 7 Create a rndc.key file. Copying the RNDC.CONF file About KEY and CONTROLS Fields Creating a named.key.8 creates a named.key. You can edit files according to your actual needs. At the same time, you should create a corresponding database. These are not detailed. Reference article: http://bbs.chinaUnix.net/forum/viewtopic.php?t=94879&show_type=new

However, in the documentation of MySQL-BIND, mysqldb_cle () is added after ns_server_destroy (), there is a little difference.

But when I compiled, LD couldn't find lnss_files and nss_dns, so I took this related to DBDRIVER_LIBS = -L '/ usr / local / mysql / lib' -lmysqlclient -lz -lcrypt -lnsl -lm lc -lresolv

In addition, when compiling, pay attention to environment variables, I added all the environment variables. :)

PATH = / bin: / usr / sbin: / etc: / usr / local / bin: / usr / local / sbin: / usr / ccs / bin: / usr / ucb: / usr / Local / mysql / bin: / usr / local / bin / flexexport path cc = gcc; export cc ld_library_path = / usr / local / lib: / usr / lib: / usr / local: / usr / local / mysql / lib / mysql : / usr / local / mysql / include / mysql export ld_library_path Tests the server configuration to see if there is any problem.

转载请注明原文地址:https://www.9cbs.com/read-36881.html

New Post(0)