blog.up-link.ro
2Apr/100

Installing PowerDNS with MySQL backend and PowerAdmin On CentOS

PowerDNS is a MySQL-based DNS server, written in C++ and licensed under the GPL. PowerDNS can be managed through a web interface (PowerAdmin). This guide shows how to install it on CentOS 5.

1. Installing MySQL

# yum -y install mysql mysql-server

2. Enable MySQL on boot and start MySQL server

# chkconfig --levels 235 mysqld on
# service mysqld start

Make sure the MySQL server is running:

# netstat -tap | grep mysql
tcp        0      0 *:mysql                 *:*     LISTEN   28179/mysqld

3. Set password for user root

# mysqladmin -u root password your_password

4. Install PowerDNS and PowerDNS recursor

# yum -y install pdns pdns-backend-mysql pdns-recursor

5. Setting database

# mysql -u root -p

mysql> CREATE DATABASE powerdns;

mysql> use powerdns;

mysql> CREATE TABLE domains (
id INT auto_increment,
name VARCHAR(255) NOT NULL,
master VARCHAR(128) DEFAULT NULL,
last_check INT DEFAULT NULL,
type VARCHAR(6) NOT NULL,
notified_serial INT DEFAULT NULL,
account VARCHAR(40) DEFAULT NULL,
primary key (id)
);

mysql> CREATE UNIQUE INDEX name_index ON domains(name);

mysql> CREATE TABLE records (
id INT auto_increment,
domain_id INT DEFAULT NULL,
name VARCHAR(255) DEFAULT NULL,
type VARCHAR(6) DEFAULT NULL,
content VARCHAR(255) DEFAULT NULL,
ttl INT DEFAULT NULL,
prio INT DEFAULT NULL,
change_date INT DEFAULT NULL,
primary key(id)
);

mysql> CREATE INDEX rec_name_index ON records(name);

mysql> CREATE INDEX nametype_index ON records(name,type);

mysql> CREATE INDEX domain_id ON records(domain_id);

mysql> CREATE TABLE supermasters (
ip VARCHAR(25) NOT NULL,
nameserver VARCHAR(255) NOT NULL,
account VARCHAR(40) DEFAULT NULL
);

mysql> CREATE USER 'powerdnsuser'@'%' IDENTIFIED BY 'password0';

mysql> GRANT ALL PRIVILEGES on powerdns.* to powerdnsuser@'%' identified by 'password0';
mysql> mysql> FLUSH PRIVILEGES;

mysql> quit;

or you can download powerdns.sql file and import the sql file by typing:

# mysql -u root -p < powerdns.sql

Edit pdns-recursor configuration file /etc/pdns-recursor/recursor.conf and add the following lines:

allow-from=127.0.0.1
local-address=127.0.0.1
local-port=53

Edit /etc/pdns/pdns.conf and add the following lines:

# launch Which backends to launch and order to query them in
# launch=
launch=gmysql
gmysql-host=localhost
gmysql-user=powerdnsuser
gmysql-password=password0
gmysql-dbname=powerdns

allow-recursion-override=yes
recursor=127.0.0.1

6. Create system startup links for PowerDNS and PowerDNS recursor on boot

# chkconfig --levels 235 pdns on
# chkconfig --levels 235 pdns-recursor on

7. Start PowerDNS and PowerDNS recursor

# service pdns start
# service pdns-recursor start

8. Preparing PowerAdmin installation

You have to install the following packages:
# yum -y install httpd php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mhash gettext

9. Create system startup links for apache and start apache

# chkconfig --levels 235 httpd on
# service httpd start

10. Install following two PEAR packages

# yum -y install php-pear-DB php-pear-MDB2-Driver-mysql

11. Install and set up PowerAdmin

# wget https://www.poweradmin.org/download/poweradmin-2.1.4.tgz

# tar zxvf poweradmin-2.1.4.tgz -C /var/www/html/

# mv poweradmin-2.1.4 poweradmin

# chown -R apache:apache /var/www/html/poweradmin/

Open http://yourserver/poweradmin/install/ and follow the setup instructions.

Print This Post Print This Post
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


*

No trackbacks yet.