powerdns mysql_PowerDNS安装部署

该博客详细记录了在CentOS系统中安装PowerDNS域名解析服务,以及配置连接MariaDB数据库的过程。同时,还涵盖了安装PowerAdmin管理面板,配置LAMP环境,并设置数据库权限。最后,通过浏览器完成PowerAdmin的安装和登录,实现DNS管理的自动化。
摘要由CSDN通过智能技术生成

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

8730d762a8de?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

install1.png

8730d762a8de?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

install2.png

8730d762a8de?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

install3.png

配置config.inc.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';

8730d762a8de?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

install4.png

8730d762a8de?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

install5.png

8730d762a8de?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

install6.png

安装后登陆

8730d762a8de?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

login7.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值