{"id":5422,"date":"2014-12-03T14:49:56","date_gmt":"2014-12-03T20:49:56","guid":{"rendered":"https:\/\/secure.rosehosting.com\/blog\/?p=5422"},"modified":"2022-06-03T03:46:31","modified_gmt":"2022-06-03T08:46:31","slug":"install-powerdns-and-on-a-centos-7-vps","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/install-powerdns-and-on-a-centos-7-vps\/","title":{"rendered":"Install PowerDNS and Poweradmin on a CentOS 7 VPS"},"content":{"rendered":"
In this tutorial, we will show you how to install PowerDNS and Poweradmin on a CentOS 7 VPS<\/a> with Nginx, MariaDB and PHP-FPM. PowerDNS is a high-performance and reliable DNS server, written in C++ and can be used as an alternative to BIND. This guide should work on other Linux VPS<\/a> systems as well but was tested and written for CentOS 7 VPS.<\/p>\n <\/p>\n To install MariaDB server run the following command:<\/p>\n To start the service and enable it at the boot time run:<\/p>\n It is very important to secure your MariaDB server, run the following script before creating and populating the databases.<\/p>\n Once you are finished with the step above, login as a MariaDB root and create a new database and tables:<\/p>\n To install the latest version of powerdns just run:<\/p>\n Open the `\/etc\/pdns\/pdns.conf` file and add the following lines:<\/p>\n and restart the Power DNS service:<\/p>\n Installing PHP and Nginx is pretty easy, just run the following command:<\/p>\n To change PHP-FPM to listen on a unix socket, open the default www pool<\/p>\n and change from:<\/p>\n to:<\/p>\n and restart the service for changes to take effect.<\/p>\n Create a php session directory and change the ownership to apache (the user under which PHP runs).<\/p>\n Create a new Nginx server block with the following content:<\/p>\n Test the Nginx configuration and restart the server by running the following commands:<\/p>\n To download and extract the latest version of Poweradmin, run the followind commands:<\/p>\n Set the correct permissions:<\/p>\n To start the installation wizard, open your browser and type Step 1: Select the desired language, After the installation wizard completes, remove the install directory using the following command:<\/p>\n That’s it, you have successfully installed PowerDNS and Poweradmin on your VPS!<\/p>\n Of course you don\u2019t have to do any of this if you use one of our Linux VPS Hosting<\/a> services, in which case you can simply ask our expert Linux admins to set this up for you. They are available 24×7 and will take care of your request immediately. For updates, you can also check Install PowerDNS and PowerAdmin on an Ubuntu 14.04 VPS<\/a>.<\/p>\n PS<\/span>.<\/strong> If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" In this tutorial, we will show you how to install PowerDNS and Poweradmin on a CentOS 7 VPS with Nginx, … <\/p>\nInstall EPEL repository<\/h4>\n
rpm -Uhv http:\/\/mirror.cc.columbia.edu\/pub\/linux\/epel\/7\/x86_64\/e\/epel-release-7-10.noarch.rpm\nroot@vps:~# yum -y update<\/pre>\n
Install MariaDB<\/h4>\n
root@vps:~# yum install mariadb-server mariadb<\/pre>\n
root@vps:~# systemctl start mariadb.service\nroot@vps:~# systemctl enable mariadb.service<\/pre>\n
mysql_secure_installation<\/pre>\n
root@vps:~# mysql -uroot -p<\/pre>\n
create database powerdns;\nGRANT ALL PRIVILEGES ON powerdns.* TO 'powerdns'@'localhost' IDENTIFIED BY 'powerdnsPassword';\nuse powerdns;\n\nCREATE TABLE domains (\nid INT auto_increment,\nname VARCHAR(255) NOT NULL,\nmaster VARCHAR(128) DEFAULT NULL,\nlast_check INT DEFAULT NULL,\ntype VARCHAR(6) NOT NULL,\nnotified_serial INT DEFAULT NULL,\naccount VARCHAR(40) DEFAULT NULL,\nprimary key (id)\n);\nCREATE UNIQUE INDEX name_index ON domains(name);\n\nCREATE TABLE records (\nid INT auto_increment,\ndomain_id INT DEFAULT NULL,\nname VARCHAR(255) DEFAULT NULL,\ntype VARCHAR(6) DEFAULT NULL,\ncontent VARCHAR(255) DEFAULT NULL,\nttl INT DEFAULT NULL,\nprio INT DEFAULT NULL,\nchange_date INT DEFAULT NULL,\nprimary key(id)\n);\nCREATE INDEX rec_name_index ON records(name);\nCREATE INDEX nametype_index ON records(name,type);\nCREATE INDEX domain_id ON records(domain_id);\n\nCREATE TABLE supermasters (\nip VARCHAR(25) NOT NULL,\nnameserver VARCHAR(255) NOT NULL,\naccount VARCHAR(40) DEFAULT NULL\n);\nexit;\n<\/pre>\n
Install PDNS<\/h4>\n
root@vps:~# yum install pdns-backend-mysql pdns<\/pre>\n
launch=gmysql\ngmysql-host=localhost\ngmysql-user=powerdns\ngmysql-password=powerdnsPassword\ngmysql-dbname=powerdns<\/pre>\n
systemctl restart pdns.service\nsystemctl enable pdns.service<\/pre>\n
Install and configure PHP and Nginx<\/h4>\n
root@vps:~# yum install nginx php-fpm php-cli php-mysqlnd php-mcrypt<\/pre>\n
root@vps:~# vim \/etc\/php-fpm.d\/www.conf<\/pre>\n
listen = 127.0.0.1:9000<\/pre>\n
listen = \/var\/run\/php-fpm\/php-fpm.socket<\/pre>\n
root@vps:~# systemctl restart php-fpm<\/pre>\n
root@vps:~# mkdir \/var\/lib\/php\/session<\/pre>\n
root@vps:~# chown apache:apache \/var\/lib\/php\/session<\/pre>\n
root@vps:~# cat <<'EOF' >> \/etc\/nginx\/conf.d\/pdns.your-domain.com.conf\nserver {\nserver_name pdns.your-domain.com;\nlisten 80;\nroot \/var\/www\/html\/pdns.your-domain.com;\naccess_log \/var\/log\/nginx\/pdns.your-domain.com-access.log;\nerror_log \/var\/log\/nginx\/pdns.your-domain.com-error.log;\nindex index.php;\n\nlocation \/ {\ntry_files $uri $uri\/ \/index.php?$query_string;\n}\n\nlocation ~ \\.php$ {\nfastcgi_index index.php;\nfastcgi_split_path_info ^(.+\\.php)(.*)$;\nfastcgi_keep_conn on;\ninclude \/etc\/nginx\/fastcgi_params;\nfastcgi_pass unix:\/var\/run\/php-fpm\/php-fpm.socket;\nfastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\n}\n\nlocation ~ \/\\.ht {\ndeny all;\n}\n\n}\nEOF<\/pre>\n
root@vps:~# nginx -t\nroot@vps:~# systemctl restart nginx<\/pre>\n
Install Poweradmin<\/h4>\n
root@vps:~# mkdir -p \/var\/www\/html\/pdns.your-domain.com\/\nroot@vps:~# cd \/var\/www\/html\/pdns.your-domain.com\/\nroot@vps:~# wget http:\/\/downloads.sourceforge.net\/project\/poweradmin\/poweradmin-2.1.7.tgz\nroot@vps:~# tar -xvzf poweradmin-2.1.7.tgz\nroot@vps:~# mv poweradmin-2.1.7\/* .\nroot@vps:~# rm -rf poweradmin-2.1.7*\n<\/pre>\n
root@vps:~# chown -R apache:apache \/var\/www\/html\/pdns.your-domain.com\/<\/pre>\n
http:\/\/pdns.your-domain.com\/installer<\/code><\/p>\n
\nStep 2: Just click on the “Go to step 3” button
\nStep 3: Fill the database information fields, select “MySQL” for Database type and “localhost” for the “Hostname” and set the Poweradmin administrator password.
\nStep 4: Set the username and password for Poweradmin, Hostmaster and Primary and Secondary nameservers.
\nStep 5: Before going to next step to create less privileged user poweradmin, perform the mariadb command shown on the screen.
\nStep 6: If you have set the correct permissions the installer will create your poweradmin php configuration file.<\/p>\nroot@vps:~# rm -rf install\/<\/pre>\n
\n