日历

2017年十二月
« 9月    
 123
45678910
11121314151617
18192021222324
25262728293031

最近评论

    linux企业应用

    在Centos上安装PowerDNS和Mysql

    什么是PowerDNS?
    PowerDNS是一个以MySQL为基础的DNS服务器,使用C++编写并遵循GPL许可的,并且能够通过web界面管理(PowerAdmin)。这篇教程将教你如何在CentOS上安装它。

    1. 安装MySQL

    [root@server ~]# yum -y install mysql mysql-server

    2.为MySQL创建启动链接

    [root@server ~]# chkconfig --levels 235 mysqld on
    [root@server ~]# service mysqld start

    3.检查MySQL是否运行

    [root@server ~]# netstat -tap | grep mysql
    tcp        0      0 *:mysql                 *:*     LISTEN   28179/mysqld

    4.重新设置Root密码

    [root@server ~]# mysqladmin -u root password password123

    5.安装PowerDNS

    [root@server ~]# yum -y install pdns pdns-backend-mysql

    6.新建数据库

    [root@server ~]# mysql -u root -p
    mysql> CREATE DATABASE powerdns;
    mysql> user 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> quit;
    [root@server ~]# nano /etc/pdns/pdns.conf
    #################################
    # launch Which backends to launch and order to query them in
    #
    # launch=
     
    launch=gmysql
     
    gmysql-host=192.200.200.1
     
    gmysql-user=power_admin
     
    gmysql-password=password123
     
    gmysql-dbname=powerdns
     
    #################################

    7.为PowerDNS创建系统启动链接

    [root@server ~]# chkconfig --levels 235 pdns on
    [root@server ~]# service pdns start

    8.在系统中安装PowerAdmin所需的软件

    [root@server ~]# 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.创建apache的启动链接并启动

    [root@server ~]# chkconfig --levels 235 httpd on
    [root@server ~]# service httpd start

    10.安装下面两个PEAR包

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

    11.下载PowerAdmin

    [root@server ~]# wget https://www.poweradmin.org/download/poweradmin-2.1.2.tgz
    [root@server ~]# tar zxvf poweradmin-2.1.2.tgz -C /var/www/html/
    [root@server ~]# mv poweradmin-2.1.2 poweradmin
    [root@server ~]# mv /var/www/html/poweradmin/inc/config.inc.php
    [root@server ~]# chown -R apache:apache /var/www/html/poweradmin/

    12.相关链接

    http://www.howtoforge.com/installing-powerdns-with-mysql-on-centos

    评论已关闭。