Skip to content
This repository has been archived by the owner on Mar 5, 2020. It is now read-only.

Installation

kennethkalmer edited this page Sep 12, 2010 · 8 revisions

Introduction

PowerDNS on Rails is a Rails application and therefore requires the necessary commands to be in place. You’ll at least need Ruby, RubyGems, and Rake setup to get things to work properly. Additional recommended gems include Mongrel, and God. There are plenty of documents online showing you how to set these up for your OS of choice so they will not be covered here.

Get and Unpack the Code

Running the code in development mode is the goal, as production-specific implementations aren’t covered yet.
Grab the latest code from GitHub in either a package, or by cloning the git repository and save it somewhere handy like $HOME/powerdnsonrails/

It is recommended to use git to clone the repo, the aim is to have the master branch ready for deployment at any given time. Then periodically run git pull to get the latest updates and review them.

Solaris users, Joe Honnald on the PowerDNS users list help me trace down a issue with Solaris’ tar not extracting the entire archive. Please use GNU tar if you are downloading the tarball.

Create the Databases

Create the databases. They can be named whatever exists in the config/database.yml file but the current defaults for Development, Test and Production are named powerdns_development, powerdns_test, and powerdns_production respectively. These databases need to exist so create then now


$ mysql -h localhost -u root -p <password>
mysql> create database powerdns_development;
mysql> create database powerdns_test;
mysql> create database powerdns_production;

Then migrate the database


$ cd powerdnsonrails
$ rake db:migrate

Seed Data

In true style, PowerDNS on Rails adds some seed data to show you how to get going. Here is how to load it (after setting up the database):


$ cd powerdns-on-rails
$ rake db:seed

After the seed data has been loaded you can login using admin and secret.

Local server

To run PowerDNS on Rails locally, simply do:


$ cd powerdns-on-rails
$ ./script/server

and open the site on port 3000 of the host running the server.

PowerDNS Configuration

Make sure you modify your PowerDNS configuration to use the powerdns_development database by changing the following line in your pdns.conf

gmysql-dbname=powerdns_development

Here is a sample pdns.conf file for local development. This is not a production config file


allow-recursion=0.0.0.0/0
config-dir=/usr/local/etc
daemon=yes
default-ttl=60
disable-axfr=no
disable-tcp=no
launch=gmysql
gmysql-host=127.0.0.1
gmysql-user=root
gmysql-dbname=powerdns_development
local-address=0.0.0.0
logging-facility=local7
loglevel=4
master=yes
webserver=yes
webserver-address=0.0.0.0
webserver-port=8081