Installing REMI and EPEL Repositories and Required Packages
To begin, you need to install the REMI and EPEL repositories on your VPS. Open your VPS shell and execute the following commands:
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
yum -y install php php-mcrypt php-pdo php-mysql pdns pdns-backend-mysql mysql-server nano
Setting Up the Database
Next, start the MySQL and Apache services:
service mysqld start
service httpd start
Create a database named powerdns
and set up a user for PowerDNS with the following commands:
mysqladmin create powerdns
mysql -Bse "create user 'powerdns'@'localhost' identified by 'password'"
mysql -Bse "grant all privileges on powerdns.* to 'powerdns'@'localhost'"
Make sure to replace 'password'
with a strong password of your choice.
Creating PowerDNS Tables
Access the MySQL console to create the necessary databases and tables for PowerDNS:
mysql
Once in the MySQL console, run the following commands:
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)
);
CREATE UNIQUE INDEX name_index ON domains(name);
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)
);
CREATE INDEX rec_name_index ON records(name);
CREATE INDEX nametype_index ON records(name,type);
CREATE INDEX domain_id ON records(domain_id);
CREATE TABLE supermasters (
ip VARCHAR(25) NOT NULL,
nameserver VARCHAR(255) NOT NULL,
account VARCHAR(40) DEFAULT NULL
);
Exit the MySQL console by typing:
exit
Installing PowerAdmin
Download and extract PowerAdmin:
cd /root
wget https://github.com/downloads/poweradmin/poweradmin/poweradmin-2.1.6.tgz
tar xvfz poweradmin-2.1.6.tgz
Navigate to the PowerAdmin directory and configure the settings:
cd poweradmin-2.1.6/inc
mv config-me.inc.php config.inc.php
nano config.inc.php
Update the config.inc.php
file with your database details, ensuring you replace the placeholders with your chosen password and session key:
$db_host = 'localhost';
$db_port = '3306';
$db_user = 'powerdns';
$db_pass = 'password';
$db_name = 'powerdns';
$db_type = 'mysql';
$session_key = 'session_key';
Deploying PowerAdmin
Move the PowerAdmin files to Apache's DocumentRoot:
mv /root/poweradmin-2.1.6/* /var/www/html/
service httpd restart
Configuring PowerDNS
Edit the PowerDNS configuration file to integrate with your MySQL database:
nano /etc/pdns/pdns.conf
Add the following lines, replacing password
with the one you used earlier:
launch=gmysql
gmysql-host=localhost
gmysql-user=powerdns
gmysql-password=password
gmysql-dbname=powerdns
Restart the PowerDNS service to apply the changes:
service pdns restart
Setting Up PowerAdmin
To finalize the installation, navigate to the installation directory in your web browser:
- Go to
http://your_vps_ip/install/
(replace your_vps_ip
with your server's IP address).
- Follow the on-screen instructions to create a PowerAdmin admin account.
Once the installation is complete and you reach Step 7, remove the installation directory for security purposes:
rm -rf /var/www/html/install
You can now access PowerAdmin at http://your_vps_ip/
and log in with the admin credentials you created during setup.