Difference between revisions of "PowerDNS OpenDBX Backend/Installation"

From Linuxnetworks
Jump to: navigation, search
(Database setup)
(removed backlink)
 
(23 intermediate revisions by 2 users not shown)
Line 1: Line 1:
__TOC__
+
== Compilation ==
  
= Installation =
+
If you don't want to use a pre-compiled package from your favorite distribution, you have to build the [http://www.powerdns.com/ PowerDNS] binaries for your platform yourself.
  
== Compilation ==
+
Before performing the steps to compile the PowerDNS server and the OpenDBX backend you have to install the [[OpenDBX]] library, the OpenDBX backend you would like to use and its development package, which includes the necessary header.
  
Before performing the steps to compile the PowerDNS server and the OpenDBX backend you have to install the OpenDBX library, the OpenDBX backend you want to use and its development package, which includes the necessary header. The OpenDBX package can be downloaded from [http://www.linuxnetworks.de/opendbx/download/ Linuxnetworks.de].
+
Apply these steps to the source [http://downloads.powerdns.com/releases/ pdns-x.xx.tar.gz] file:  
 
+
Apply these steps to the source pdns-x.xx.tar.gz file, if you don't want to use a precompiled package:
+
  
 
  * Extract the pdns tar file
 
  * Extract the pdns tar file
 
  * Change into the newly created pdns directory
 
  * Change into the newly created pdns directory
 
  * Extract the opendbxbackend tar file
 
  * Extract the opendbxbackend tar file
  * Run "cat opendbxbackend.diff | patch -p1"
+
  * Run "cat <patch> | patch -p1" (if available)
 
  * Type ./configure --help for the available options
 
  * Type ./configure --help for the available options
 
  * For dynamic modules:
 
  * For dynamic modules:
 
   ./configure
 
   ./configure
 +
      --prefix=/usr
 
       --with-modules=""
 
       --with-modules=""
 
       --with-dynmodules="opendbx"
 
       --with-dynmodules="opendbx"
      --enable-recursor
 
 
  * For a static module:
 
  * For a static module:
 
   ./configure
 
   ./configure
 +
      --prefix=/usr
 
       --with-modules="opendbx"
 
       --with-modules="opendbx"
 
       --with-dynmodules=""
 
       --with-dynmodules=""
      --enable-recursor
 
 
  * make && make install
 
  * make && make install
 
== Configuration options ==
 
 
There are a few options through the OpenDBX backend can be configured for your environment. Add them to the pdns.conf file located in /etc/powerdns or /usr/local/etc/ (depends on your configuration while compiling):
 
 
; opendbx-backend (default "mysql") : Name of the backend used to connect to the database server. Currently mysql, pgsql, sqlite and sqlite3 are available.
 
 
; opendbx-host-read (default "127.0.0.1") : One or more host names, IP addresses or - in case of sqlite and sqlite3 - the directory path to the database file including a trailing slash or backslash (depending on your operating system). These hosts will be used for retrieving the records via SELECT queries.
 
 
; opendbx-host-write (default "127.0.0.1") : Same as opendbx-host-read, except for INSERT/UPDATE statements (mostly used by zonetransfers).
 
 
; opendbx-port (default "") : TCP/IP port number where the database server is listening to. Most databases will use their default port if you leave this empty.
 
 
; opendbx-database (default "powerdns") : The database name where all domain and record entries are stored. In case of sqlite and sqlite3 it's the name of the database file without leasing slash or backslash.
 
 
; opendbx-username (default "powerdns") : Name of the user send to the DBMS for authentication.
 
 
; opendbx-password (default "") : Clear text password for authentication in combination with the username.
 
 
; opendbx-host (deprecated, default "127.0.0.1") : Host name, IP address or - in case of sqlite and sqlite3 - the directory path to the database file including a trailing slash or backslash (depending on your operating system). This parameter is deprecated in favor of opendbx-host-read and opendbx-host-write.
 
 
== Database setup ==
 
 
You need one of the DBMS supported by the OpenDBX library for storing your records and domain infomation. Please have a look at the documentation of your DBMS for the task of creating a database and an user.
 
 
After that you're almost done. Use the appropriate table definition below to create the tables in the new database.
 
 
* [http://www.linuxnetworks.de/pdnsodbx/download/tables-mysql.sql MySQL]
 
* [http://www.linuxnetworks.de/pdnsodbx/download/tables-pgsql.sql PostgreSQL]
 
* [http://www.linuxnetworks.de/pdnsodbx/download/tables-sqlite.sql SQLite]
 
 
== Migration ==
 
 
To convert an existing gMySQL Database to an OpenDBX MySQL database, no changes are required per-se. But adding a foreign key from records.domain_id to domains.id is a good idea anyway:
 
 
ALTER TABLE records ADD CONSTRAINT fk_records_domainid
 
FOREIGN KEY (domain_id) REFERENCES domains (id)
 
ON UPDATE CASCADE ON DELETE CASCADE;
 
 
 
----
 
Back to [[PowerDNS OpenDBX Backend|Overview]]
 

Latest revision as of 14:36, 22 June 2008

Compilation

If you don't want to use a pre-compiled package from your favorite distribution, you have to build the PowerDNS binaries for your platform yourself.

Before performing the steps to compile the PowerDNS server and the OpenDBX backend you have to install the OpenDBX library, the OpenDBX backend you would like to use and its development package, which includes the necessary header.

Apply these steps to the source pdns-x.xx.tar.gz file:

* Extract the pdns tar file
* Change into the newly created pdns directory
* Extract the opendbxbackend tar file
* Run "cat <patch> | patch -p1" (if available)
* Type ./configure --help for the available options
* For dynamic modules:
  ./configure
     --prefix=/usr
     --with-modules=""
     --with-dynmodules="opendbx"
* For a static module:
  ./configure
     --prefix=/usr
     --with-modules="opendbx"
     --with-dynmodules=""
* make && make install