官方網站

mydns http://mydns.bboy.net/

MyDNS-ng http://www.mydns-ng.com/

mydnsconfig:  MyDNSConfig Homepag

安裝環境 Centos6.8 64bit  MariaDB10.1 PHP5.5.16 Apache2.2.27 mydns-1.2.8.31 MyDNSConfig-3.0.1 or MyDNSConfig-1.1.0

請先安裝好LAMP環境

1.安裝mydns

cd /usr/local/src

tar -zxvf mydns-1.2.8.31.tar.gz

cd mydns-1.2.8.31

./configure --prefix=/usr/local/mydns --with-mysql-lib=/usr/lib64/mysql --with-zlib=/usr/lib64

make; make install

編譯過程如遇到configure: error: No supported database found.  Either MySQL or PostgreSQL is required.

請確認是否有/usr/lib64/mysql/libmysqlclient.so 這支檔案

chmod 755 /usr/lib64/libmysqlclient.so.15

ln -s /usr/lib64/libmysqlclient.so.15 /usr/lib64/mysql/libmysqlclient.so

ln -s /usr/lib64/libmysqlclient_r.so.15 /usr/lib64/mysql/libmysqlclient_r.so

重新載入ldconfig

ldconfig

拷貝設定檔到/etc底下

cp /root/mydns-1.2.8.31/mydns.conf /etc/

建立啟動腳本

vi /etc/init.d/mydns

####

#! /bin/sh   

# mydns         Start the MyDNS server   

# Author:       Falko Timme <>.   

# chkconfig: - 80 75

# description: mydns


set -e   

PATH=/usr/local/mydns/sbin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin   

NAME=mydns   

DAEMON=/usr/local/mydns/sbin/$NAME   

DESC="MyDNS Server" 

SCRIPTNAME=/etc/init.d/$NAME   

# Gracefully exit if the package has been removed.   

test -x $DAEMON || exit 0   

case "$1" in 

  start)   

         echo -n "Starting $DESC: $NAME" 

         $DAEMON --background   

         echo "." 

         ;;   

   stop)   

         echo "Stopping $DESC: $NAME." 

         kill -9 `pidof $NAME` &> /dev/null   

         ;;   

   restart)   

         echo "Restarting $DESC: $NAME." 

         $0 stop && sleep 1   

         $0 start   

         ;;   

   *)   

         echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2   

         exit 1   

         ;;   

esac   

exit 0

####

2.安裝MyDNSConfig-3.0.1

下載

https://sourceforge.net/projects/mydnsconfig/files/mydnsconfig/MyDNSConfig-3.0.1/MyDNSConfig-3.0.1.tar.gz/download?use_mirror=netix&use_mirror=

tar -zxvf MyDNSConfig-3.0.1.tar.gz
cd mydnsconfig/install

編譯 ./lib/install.lib.php 找到以下這段

if(stristr($content,'CentOS release 5.2 (Final)')) { 

   $distname = 'CentOS'; 

   $distver = '5.2'; 

   $distid = 'centos52'; 

   $distbaseid = 'fedora'; 

   swriteln("Operating System: CentOS 5.2 or compatible\n"); 

  }

更改為你的os版本

if(stristr($content,'CentOS release 6.8 (Final)')) { 

   $distname = 'CentOS'; 

   $distver = '6.8'; 

   $distid = 'centos52';  ## 此處不要改

   $distbaseid = 'fedora'; 

   swriteln("Operating System: CentOS 6.8 or compatible\n");

不改安裝時會出現以下錯誤

PHP Notice: Undefined variable: distver in /tmp/ispconfig3_install/install/lib/install.lib.php on line 135
PHP Notice: Undefined variable: distid in /tmp/ispconfig3_install/install/lib/install.lib.php on line 135
PHP Notice: Undefined variable: distbaseid in /tmp/ispconfig3_install/install/lib/install.lib.php on line 35
Linux Distribution of Version not recognized.

執行安裝腳本

cd /root/mydnsconfig/install

php -q install

設定資料庫

預設管理port 為8080 也可以設定80

MyDNSConfig Port [8080]

設定軟連接

ln -s /var/www/ispconfig /usr/local/ispconfig/interface/web

安裝完畢後會自動寫入apache設定檔及mydns設定檔

注意:/etc/mydns.conf設定檔中為  soa-table = dns_soa、rr-table = dns_rr

啟動mydns服務

/etc/init.d/mydns start

[[email protected] ~]# /etc/init.d/mydns start
Starting MyDNS Server: mydns

設定apache vhost設定

<VirtualHost *:80>
 ServerAdmin [email protected]
 DocumentRoot /usr/local/ispconfig/interface/web
 ServerName mydns.hack.idv.tw
 ErrorLog logs/mydns.err
 CustomLog logs/mydns.acc common
</VirtualHost>

開啟網頁 預設帳號為admin /admin

測試解析正常

點閱: 135

By tony

自由軟體愛好者~喜歡不斷的思考各種問題,有新的事物都會想去學習嘗試 做實驗並熱衷研究 沒有所謂頂天的技術 只有謙虛及不斷的學習 精進專業,本站主要以分享系統及網路相關知識、資源而建立。 Github http://stnet253.github.io

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料