1. <em id="vzzs9"></em>
      <tbody id="vzzs9"></tbody>

    2. <span id="vzzs9"></span>
      <progress id="vzzs9"></progress>
      首頁 LAMP教程LAMP實戰案例:實現PowerDNS 應用部署

      LAMP實戰案例:實現Discuz!應用部署

      PHP的加速器配置介紹

      運維派隸屬馬哥教育旗下專業運維社區,是國內成立最早的IT運維技術社區,歡迎關注公眾號:yunweipai
      領取學習更多免費Linux云計算、Python、Docker、K8s教程關注公眾號:馬哥linux運維

      實現 PowerDNS 應用部署

      LAMP實戰案例:實現PowerDNS 應用部署插圖

      PowerDNS官網:https://www.powerdns.com/
      PowerDNS文檔:https://doc.powerdns.com/
      Poweradmin官網:http://www.poweradmin.org/

      LAMP實戰案例:實現PowerDNS 應用部署插圖1

      范例:CentOS 8 利用RPM包部署PowerDNS(目前20200311,不支持powerdns,缺少相關php包)

      [root@centos8 ~]#yum install -y pdns pdns-backend-mysql  mariadb-server
      [root@centos8 ~]#systemctl start mariadb
      [root@centos8 ~]#mysql < pdns.sql
      [root@centos8 ~]#vim /etc/pdns/pdns.conf
      launch=gmysql
      gmysql-host=localhost
      gmysql-port=3306
      gmysql-dbname=powerdns
      gmysql-user=powerdns
      gmysql-password=magedu  
      
      [root@centos8 ~]#grep -Ev "^#|^$" /etc/pdns/pdns.conf
      launch=gmysql  #修改此行
      gmysql-host=localhost  #以下行是增加
      gmysql-port=3306
      gmysql-dbname=powerdns
      gmysql-user=powerdns
      gmysql-password=magedu
      setgid=pdns  #以下兩行不變
      setuid=pdns
      [root@centos8 ~]#systemctl enable --now pdns
      [root@centos8 ~]#ss -ntlpu |grep pdns_server
      udp    UNCONN   0        0                 0.0.0.0:53             0.0.0.0:*      users:(("pdns_server",pid=3073,fd=9))                                          
      udp    UNCONN   0        0                    [::]:53                [::]:*      users:(("pdns_server",pid=3073,fd=10))                                         
      tcp    LISTEN   0        128               0.0.0.0:53             0.0.0.0:*      users:(("pdns_server",pid=3073,fd=11))                                         
      tcp    LISTEN   0        128                  [::]:53                [::]:*      users:(("pdns_server",pid=3073,fd=12))                                         
      [root@centos8 ~]#yum -y install httpd php php-devel php-gd  php-ldap php-mysqlnd php-odbc php-pear php-xml php-xmlrpc  php-mhash gettext
      [root@centos8 ~]#systemctl restart httpd

      LAMP實戰案例:實現PowerDNS 應用部署插圖2

      范例:CentOS 7 利用RPM包部署PowerDNS

      #安裝包:基于EPEL源
      [root@centos7 ~]#yum install -y pdns pdns-backend-mysql mariadb-server
      [root@centos7 ~]#systemctl enable --now  mariadb
      
      #準備mariadb中的數據庫,表和用戶
      [root@centos7 ~]#mysql
      MariaDB [(none)]> CREATE DATABASE powerdns;
      MariaDB [(none)]> GRANT ALL ON powerdns.* TO 'powerdns'@'localhost' IDENTIFIED BY 'magedu';
      #創建powerdns數據庫中的表,參看下面文檔實現
      #https://doc.powerdns.com/md/authoritative/backend-generic-mysql/
      
      use powerdns;
      
      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)
      ) Engine=InnoDB;
      
      CREATE UNIQUE INDEX name_index ON domains(name);
      
      CREATE TABLE records (
        id                    BIGINT AUTO_INCREMENT,
        domain_id             INT DEFAULT NULL,
        name                  VARCHAR(255) DEFAULT NULL,
        type                  VARCHAR(10) DEFAULT NULL,
        content               VARCHAR(64000) DEFAULT NULL,
        ttl                   INT DEFAULT NULL,
        prio                  INT DEFAULT NULL,
        change_date           INT DEFAULT NULL,
        disabled              TINYINT(1) DEFAULT 0,
        ordername             VARCHAR(255) BINARY DEFAULT NULL,
        auth                  TINYINT(1) DEFAULT 1,
        PRIMARY KEY (id)
      ) Engine=InnoDB;
      
      CREATE INDEX nametype_index ON records(name,type);
      CREATE INDEX domain_id ON records(domain_id);
      CREATE INDEX recordorder ON records (domain_id, ordername);
      
      CREATE TABLE supermasters (
        ip                    VARCHAR(64) NOT NULL,
        nameserver            VARCHAR(255) NOT NULL,
        account               VARCHAR(40) NOT NULL,
        PRIMARY KEY (ip, nameserver)
      ) Engine=InnoDB;
      
      CREATE TABLE comments (
        id                    INT AUTO_INCREMENT,
        domain_id             INT NOT NULL,
        name                  VARCHAR(255) NOT NULL,
        type                  VARCHAR(10) NOT NULL,
        modified_at           INT NOT NULL,
        account               VARCHAR(40) NOT NULL,
        comment               VARCHAR(64000) NOT NULL,
        PRIMARY KEY (id)
      ) Engine=InnoDB;
      
      CREATE INDEX comments_domain_id_idx ON comments (domain_id);
      CREATE INDEX comments_name_type_idx ON comments (name, type);
      CREATE INDEX comments_order_idx ON comments (domain_id, modified_at);
      
      CREATE TABLE domainmetadata (
        id                    INT AUTO_INCREMENT,
        domain_id             INT NOT NULL,
        kind                  VARCHAR(32),
        content               TEXT,
        PRIMARY KEY (id)
      ) Engine=InnoDB;
      
      CREATE INDEX domainmetadata_idx ON domainmetadata (domain_id, kind);
      
      CREATE TABLE cryptokeys (
        id                    INT AUTO_INCREMENT,
        domain_id             INT NOT NULL,
        flags                 INT NOT NULL,
        active                BOOL,
        content               TEXT,
        PRIMARY KEY(id)
      ) Engine=InnoDB;
      
      CREATE INDEX domainidindex ON cryptokeys(domain_id);
      
      CREATE TABLE tsigkeys (
        id                    INT AUTO_INCREMENT,
        name                  VARCHAR(255),
        algorithm             VARCHAR(50),
        secret                VARCHAR(255),
        PRIMARY KEY (id)
      ) Engine=InnoDB;
      
      CREATE UNIQUE INDEX namealgoindex ON tsigkeys(name, algorithm);
      
      #配置PowerDNS使用mariadb作為后臺數據存儲
      [root@centos7 ~]#vim /etc/pdns/pdns.conf,查找到包含launch= 的行,修改并添加下面的內容 
      launch=gmysql  #修改此行
      gmysql-host=localhost #以下行是增加的
      gmysql-port=3306
      gmysql-dbname=powerdns
      gmysql-user=powerdns 
      gmysql-password=magedu
      
      [root@centos7 ~]#grep -Ev "^#|^$" /etc/pdns/pdns.conf
      launch=gmysql
      gmysql-host=localhost
      gmysql-port=3306
      gmysql-dbname=powerdns
      gmysql-user=powerdns
      gmysql-password=magedu
      setgid=pdns
      setuid=pdns
      
      #啟動服務
      [root@centos7 ~]#systemctl enable --now pdns
      [root@centos7 ~]#ss -ntl
      State      Recv-Q Send-Q              Local Address:Port                             Peer Address:Port              
      LISTEN     0      100                     127.0.0.1:25                                          *:*                  
      LISTEN     0      50                              *:3306                                        *:*                  
      LISTEN     0      128                             *:53                                          *:*                  
      LISTEN     0      128                             *:22                                          *:*                  
      LISTEN     0      100                         [::1]:25                                       [::]:*                  
      LISTEN     0      128                          [::]:53                                       [::]:*                  
      LISTEN     0      128                          [::]:22                                       [::]:*   
      
      #安裝httpd和php相關包
      [root@centos7 ~]#yum -y install httpd php php-devel php-gd php-mcrypt php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mhash gettext
      
      [root@centos7 ~]#systemctl enable --now httpd
      #下載poweradmin程序,并解壓縮到相應目錄
      [root@centos7 ~]#wget http://downloads.sourceforge.net/project/poweradmin/poweradmin-2.1.7.tgz
      [root@centos7 ~]#tar xvf poweradmin-2.1.7.tgz  -C /var/www/html
      [root@centos7 ~]#cd /var/www/html
      [root@centos7 ~]#mv poweradmin-2.1.7 poweradmin

      訪問下面地址,啟動PowerAdmin的網頁安裝向導:

      http://powerdns服務器IP/poweradmin/install/

      LAMP實戰案例:實現PowerDNS 應用部署插圖3
      LAMP實戰案例:實現PowerDNS 應用部署插圖4

      提供先前配置的數據庫詳情,同時為Poweradmin設置管理員密碼

      LAMP實戰案例:實現PowerDNS 應用部署插圖5

      為Poweradmin創建一個受限用戶
      說明:
      Username:PowerAdmin用戶名
      Password:上述用戶的密碼
      Hostmaster:當創建SOA記錄指定默認主機管理員
      Primary nameserver:主域名服務器
      Secondary namesever:輔域名服務器

      LAMP實戰案例:實現PowerDNS 應用部署插圖6

      按照下面頁面說明,在數據庫中創建用戶并授權

      MariaDB [(none)]>GRANT SELECT, INSERT, UPDATE, DELETE ON powerdns.* TO 'poweradmin'@'localhost‘  IDENTIFIED BY 'magedu';

      LAMP實戰案例:實現PowerDNS 應用部署插圖7

      按下面頁面說明,創建config.in.php文件內容

      vim /var/www/html/poweradmin/inc/config.inc.php

      LAMP實戰案例:實現PowerDNS 應用部署插圖8

      安裝完畢后

      LAMP實戰案例:實現PowerDNS 應用部署插圖9

      刪除install目錄

      rm -rf /var/www/html/poweradmin/install/

      登錄http://powerdns服務器IP/poweradmin/

      username:admin
      password:magedu 參看第step 3

      LAMP實戰案例:實現PowerDNS 應用部署插圖10
      LAMP實戰案例:實現PowerDNS 應用部署插圖11

      本文鏈接:http://www.abandonstatusquo.com/36080.html

      LAMP實戰案例:實現Discuz!應用部署

      PHP的加速器配置介紹

      網友評論comments

      發表評論

      您的電子郵箱地址不會被公開。

      暫無評論

      Copyright ? 2012-2022 YUNWEIPAI.COM - 運維派 京ICP備16064699號-6
      掃二維碼
      掃二維碼
      返回頂部
      久久久久亚洲国内精品|亚洲一区二区在线观看综合无码|欧洲一区无码精品色|97伊人久久超碰|一级a爱片国产亚洲精品