美文网首页
PowerDNS安装部署

PowerDNS安装部署

作者: keymanye | 来源:发表于2019-07-15 23:24 被阅读0次
    centos安装epel
    检验epel
    [root@training yum.repos.d]# ls
    CentOS-Base.repo       CentOS-fasttrack.repo  CentOS-Vault.repo
    CentOS-CR.repo         CentOS-Media.repo      epel.repo
    CentOS-Debuginfo.repo  CentOS-Sources.repo    epel-testing.repo
    
    安装powerdns
    yum clean all 
    yum makecache
    yum search pdns 
    yum install pdns -y 
    
    安装数据库
    yum install mariadb-server mariadb
    
    安装powerdns对Mariadb数据库连接插件
    yum search pdns-backend-mysql
    yum install pdns-backend-mysql.x86_64 -y 
    
    配置mariadb数据库
    systemctl start mariadb 
    systemctl enable mariadb
    mysql -u root -p 
    mysql >  create database poweradmin;
    mysql > grant all on pwoeradmin.* to puser1@localhost identified by "wisdom123@";
    mysql > select user,host,password from mysql.user;
    mysql > exit 
    mysql -u puser1 -pwisdom123@  powerdns 
    #测试用户登录
    
    创建powerdns需要表
    mysql -u root -p  powerdns< /usr/share/doc/pdns-backend-mysql-4.1.10/schema.mysql.sql
    
    配置powerdns连接mariadb数据库
    • vim /etc/pdns/pdns.conf
    launch=gmysql
    gmysql-host=localhost
    gmysql-user=puser1
    gmysql-dbname=poweradmin
    mysql-password=wisdom123@
    ##在文件250行添加
    
    检验数据库连接
    mysql -u root -p 
    mysql > show processlist 
    
    下载poweradmin
    wget https://sourceforge.net/projects/poweradmin/files/latest/download?source=directory
    
    解压缩powerdns
    [root@training ~]# ls
    poweradmin-2.1.7.tgz
    [root@training ~]# tar xvf poweradmin-2.1.7.tgz 
    poweradmin-2.1.7/
    poweradmin-2.1.7/add_zone_slave.php
    ... ... 
    poweradmin-2.1.7/add_zone_templ.php
    poweradmin-2.1.7/add_zone_templ_record.php
    poweradmin-2.1.7/list_zone_templ.php
    poweradmin-2.1.7/style/example.css
    poweradmin-2.1.7/users.php
    [root@training ~]# ls
    poweradmin-2.1.7  poweradmin-2.1.7.tgz
    [root@training ~]# cd poweradmin-2.1.7/
    [root@training poweradmin-2.1.7]# ls
    addons                     delete_zone_templ.php         inc
    add_zone_slave.php         dnssec.php                    list_zones.php
    ... ...
    delete_record.php          edit_zone_templ_record.php    sql
    delete_user.php            images                        users.php
    
    配置LAMP环境
    [root@training ~]# yum install httpd php  php-common php-curl php-devel php-gd php-pear php-imap php-mcrypt php-mhash  php-mysql php-xmlrpc gettext -y
    
    /root/poweradmin-2.1.7
    [root@training poweradmin-2.1.7]# cp -r * /var/www/html/
    [root@training poweradmin-2.1.7]# cd /var/www/html/
    [root@training html]# ls
    addons                     delete_zone_templ.php         inc
    add_perm_templ.php         delete_zone_templ_record.php  index.php
    add_record.php             dnssec_add_key.php            install
    add_supermaster.php        dnssec_delete_key.php         LICENSE
    add_user.php               dnssec_ds_dnskey.php          list_perm_templ.php
    add_zone_master.php        dnssec_edit_key.php           list_supermasters.php
    add_zone_slave.php         dnssec.php                    list_zones.php
    add_zone_templ.php         dynamic_update.php            list_zone_templ.php
    add_zone_templ_record.php  edit_comment.php              locale
    bulk_registration.php      edit_perm_templ.php           migrations
    change_password.php        edit.php                      phpdoc.dist.xml
    delete_domain.php          edit_record.php               README.md
    delete_domains.php         edit_user.php                 robots.txt
    delete_perm_templ.php      edit_zone_templ.php           search.php
    delete_record.php          edit_zone_templ_record.php    sql
    delete_supermaster.php     favicon.ico                   style
    delete_user.php            images                        users.php
    
    启动apache服务
    [root@training html]# systemctl  enable httpd 
    Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
    [root@training html]# systemctl  start httpd 
    
    创建poweradmin所需要的数据库(php程序)
    [root@training html]# mysql 
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 24
    Server version: 5.5.60-MariaDB MariaDB Server
    
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [(none)]> 
    MariaDB [(none)]> create database poweradmin;
    Query OK, 1 row affected (0.00 sec)
    
    MariaDB [(none)]> grant all on poweradmin.* to poweruser@localhost identified by "wisdom123@";
    Query OK, 0 rows affected (0.00 sec)
    
    MariaDB [(none)]> exit
    Bye
    [root@training html]# mysql -u poweruser -pwisdom123@
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MariaDB connection id is 25
    Server version: 5.5.60-MariaDB MariaDB Server
    
    Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    MariaDB [(none)]> exit
    
    启动powerdns
    systemctl enable powerdns
    systemctl start powerdns
    
    使用浏览器配置poweradmin
    • 安装poweradmin


      install1.png
    install2.png install3.png
    • 配置config.inc.php
    <?php
    
    $db_host        = 'localhost';
    $db_user        = 'puser1';
    $db_pass        = 'wisdom123@';
    $db_name        = 'poweradmin';
    $db_type        = 'mysql';
    $db_layer       = 'PDO';
    
    $session_key        = ']+I9B@gR=WNWnJ*Qw$GHkx7+wK)[YL3m+0b^48Kiv}1RU$';
    
    $iface_lang     = 'en_EN';
    
    $dns_hostmaster     = 'training.domain1.example.com';
    $dns_ns1        = '192.168.247.100';
    $dns_ns2        = '192.168.247.100';
    
    install4.png install5.png install6.png
    • 安装后登陆 login7.png

    相关文章

      网友评论

          本文标题:PowerDNS安装部署

          本文链接:https://www.haomeiwen.com/subject/mprakctx.html