This shows you the differences between two versions of the page.
Next revision | Previous revision Last revision Both sides next revision | ||
freebsd:powerdns [2016/11/18 14:08] tschulz created |
freebsd:powerdns [2016/11/18 14:46] tschulz |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== FreeBSD 11 PowerDNS ====== | + | ====== FreeBSD 11 PowerDNS and MySQL ====== |
===== Install PowerDNS Package ===== | ===== Install PowerDNS Package ===== | ||
Line 28: | Line 28: | ||
==== Set Password ==== | ==== Set Password ==== | ||
<file> | <file> | ||
- | mysqladmin -u root password "CHANGEME" | + | mysql_secure_installation # set root password to MYSQLPASSWORD |
</file> | </file> | ||
Line 34: | Line 34: | ||
==== Create PowerDNS Database ==== | ==== Create PowerDNS Database ==== | ||
<file bash> | <file bash> | ||
- | mysql -p # enter password you changed from CHANGEME | + | mysql -p # enter password you changed from MYSQLPASSWORD |
</file> | </file> | ||
<file mysql> | <file mysql> | ||
Line 44: | Line 44: | ||
</file> | </file> | ||
+ | ===== Set PowerDNS Options ===== | ||
+ | * edit /usr/local/etc/pdns/pdns.conf | ||
+ | * The following are the important directives for DNS transfers, MySQL, and the Web Frontend | ||
+ | <file> | ||
+ | allow-axfr-ips=127.0.0.0/8 #add your domain ranges to this list, this is a "," separated list | ||
+ | disable-axfr=no | ||
+ | launch=gmysql | ||
+ | gmysql-host=127.0.0.1 | ||
+ | gmysql-user=root | ||
+ | gmysql-password=MYSQLPASSWORD | ||
+ | gmysql-dbname=powerdns | ||
+ | api=yes | ||
+ | api-key=APIPASSWORD | ||
+ | webserver=yes | ||
+ | webserver-address=127.0.0.1 | ||
+ | webserver-port=8081 | ||
+ | </file> | ||
+ | |||
+ | ===== Enable PowerDNS Startup ===== | ||
+ | * add mysql to the REQUIRE line in /usr/local/etc/rc.d/pdns | ||
+ | <file> | ||
+ | ... | ||
+ | # REQUIRE: DAEMON SERVERS mysql | ||
+ | ... | ||
+ | </file> | ||
+ | * Enable and start | ||
+ | <file> | ||
+ | echo "pdns_enable=\"YES\"" > /etc/rc.conf | ||
+ | service pdns start | ||
+ | </file> | ||
+ | |||
+ | ===== Install Apache and PHP ===== | ||
+ | <file> | ||
+ | pkg install mod_php56 php56 php56-curl php56-json php56-openssl php56-session php56-sqlite3 apache24 | ||
+ | </file> | ||
+ | * Add/create the following to **/usr/local/etc/apache24/php5.conf** | ||
+ | <file> | ||
+ | <FilesMatch "\.php$"> | ||
+ | SetHandler application/x-httpd-php | ||
+ | </FilesMatch> | ||
+ | <FilesMatch "\.phps$"> | ||
+ | SetHandler application/x-httpd-php-source | ||
+ | </FilesMatch> | ||
+ | |||
+ | DirectoryIndex index.html index.php | ||
+ | </file> | ||
+ | |||
+ | * Enable and start apache | ||
+ | <file> | ||
+ | echo "apache24_enable=\"YES\"" > /etc/rc.conf | ||
+ | service apache24 start | ||
+ | </file> | ||
+ | |||
+ | ===== Install and Configure NSedit ===== | ||
+ | * download a copy of NSEDIT from [[https://github.com/tuxis-ie/nsedit]] | ||
+ | * Extract to **/usr/local/www/apache24/data** | ||
+ | * make a directory and give www:www full access to it | ||
+ | <file> | ||
+ | mkdir -p /usr/local/etc/pdns/web-db | ||
+ | chown -R www:www /usr/local/etc/pdns/web-db | ||
+ | </file> | ||
+ | * Edit ./nsedit/includes/config.inc.php and set the following values | ||
+ | <file> | ||
+ | $apipass = 'APIPASSWORD'; | ||
+ | $apiip = '127.0.0.1'; | ||
+ | $apiport = '8081'; | ||
+ | $apiproto = 'http'; | ||
+ | $authdb = "/usr/local/etc/pdns/web-db/pdns.users.sqlite3"; | ||
+ | </file> | ||
+ | ==== Login to NSEdit ==== | ||
+ | * go to http://localhost/nsedit/index.php | ||
+ | * Login with Username: **admin**, password: **admin** | ||
+ | ====== Project PKGs ====== | ||
+ | {{:freebsd:pkg_pdns_nsedit.tar.bz2|}} | ||