歡迎您光臨本站 註冊首頁

在Fedora 8上安裝MYDNS管理器

←手機掃碼閱讀     火星人 @ 2014-03-25 , reply:0

安裝MYDNS建立在MYSQL的基礎上.所以你的前提也要安裝該服務.

1 起步安裝
在例子中我們假設使用域名為server1.example.com 跟隨著設的 IP address 192.168.0.100. 這個的設置根據你自己的情況而改變.

2 安裝條件
MyDNSConfig 的是基於PHP的基礎上開發的.所以你的伺服器一定要能支持PHP才能使用它. 它要用到 webserver PHP和 MySQL server. 在這裡你也安裝 phpMyAdmin好讓你管理MYSQL:

用yum來安裝:

#yum install httpd mysql-server php php-mysql php-mbstring phpMyAdmin

Start MySQL:

設置啟動程序:
#chkconfig --levels 235 mysqld on
#/etc/init.d/mysqld start

設置你MYSQL的密碼: MySQL root account:

mysqladmin -u root password yourrootsqlpassword
mysqladmin -h server1.example.com -u root password yourrootsqlpassword

現在我們來配置phpMyAdmin.
stanza):
#vi /etc/httpd/conf.d/phpMyAdmin.conf



# phpMyAdmin - Web based MySQL browser written in php
#
# Allows only localhost by default
#
# But allowing phpMyAdmin to anyone other than localhost should be considered
# dangerous unless properly secured by SSL

Alias /phpMyAdmin /usr/share/phpMyAdmin
#
# order deny,allow
# deny from all
# allow from 127.0.0.1
#


# This directory does not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#

Order Deny,Allow
Deny from All
Allow from None


# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc. This may break your mod_security implementation.
#
#
#
# SecFilterInheritance Off
#

#


Then we create the system startup links for Apache

然後我們來啟動Apache:

#chkconfig --levels 235 httpd on
#/etc/init.d/httpd start

你可以打開IE http://server1.example.com/phpMyAdmin/ or http://192.168.0.100/phpMyAdmin/
輸入你的root and root MySQL password.

3 安裝配置 MyDNS
進入MySQL 建立資料庫:

mysql -u root -p



CREATE DATABASE mydns;
GRANT SELECT, INSERT, UPDATE, DELETE ON mydns.* TO 'mydns'@'localhost' IDENTIFIED BY 'mydnspassword';
GRANT SELECT, INSERT, UPDATE, DELETE ON mydns.* TO 'mydns'@'localhost.localdomain' IDENTIFIED BY 'mydnspassword';
FLUSH PRIVILEGES;
quit;


下載MyDNS:

#cd /tmp
#wget http://mesh.dl.sourceforge.net/s ... Config-1.1.0.tar.gz
#tar xvfz MyDNSConfig-1.1.0.tar.gz
#cd MyDNSConfig-1.1.0
安裝MyDNS:

#mkdir /usr/share/mydnsconfig
#cp -rf interface/* /usr/share/mydnsconfig/
#ln -s /usr/share/mydnsconfig/web/ /var/www/html/mydnsconfig安裝MyDNS的MySQL Database:


#mysql -u root -p mydns < install/mydnsconfig.sql
現在配置MyDNS; 設置相映的資料庫:

vi /usr/share/mydnsconfig/lib/config.inc.php


/*
Copyright (c) 2005, Till Brehm, Falko Timme, projektfarm Gmbh
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
ini_set('register_globals',0);
$conf["app_title"] = "MyDNSConfig";
$conf["app_version"] = "1.1.0";

$conf["rootpath"] = "/usr/share/mydnsconfig";
$conf["fs_div"] = "/"; // File system divider, \\ on windows and / on linux and unix
$conf["classpath"] = $conf["rootpath"].$conf["fs_div"]."lib".$conf["fs_div"]."classes";
$conf["temppath"] = $conf["rootpath"].$conf["fs_div"]."temp";

/*
Database Settings
*/

$conf["db_type"] = 'mysql';
$conf["db_host"] = 'localhost';
$conf["db_database"] = 'mydns';
$conf["db_user"] = 'mydns';
$conf["db_password"] = 'mydnspassword';

/*
External programs
*/
$conf["programs"]["wput"] = $conf["rootpath"]."/tools/wput/wput";

/*
Themes
*/
$conf["theme"] = 'grey';
$conf["html_content_encoding"] = 'text/html; charset=iso-8859-1';
$conf["logo"] = 'themes/default/images/mydnsconfig_logo.gif';
/*
Default Language
*/
$conf["language"] = 'en';

/*
Auto Load Modules
*/
$conf["start_db"] = true;
$conf["start_session"] = true;
/*
DNS Settings
*/
$conf["auto_create_ptr"] = 1; // Automatically create PTR records?
$conf["default_ns"] = 'ns1.example.com.'; // must be set if $conf['auto_create_ptr'] is 1. Don't forget the trailing dot!
$conf["default_mbox"] = 'admin.example.com.'; // Admin email address. Must be set if $conf['auto_create_ptr'] is 1. Replace "@" with ".". Don't forget the trailing dot!
$conf["default_ttl"] = 86400;
$conf["default_refresh"] = 28800;
$conf["default_retry"] = 7200;
$conf["default_expire"] = 604800;
$conf["default_minimum_ttl"] = 86400;
?>

然後刪除MyDNS的文件 /tmp directory:

#cd /tmp
#rm -rf MyDNSConfig-1.1.0/
#rm -f MyDNSConfig-1.1.0.tar.gz

4 安裝 MyDNS
下載代碼: download the mydns-mysql rpm package from http://mydns.bboy.net/download/ :

#wget http://mydns.bboy.net/download/mydns-mysql-1.1.0-1.i386.rpm
#rpm -ivh mydns-mysql-1.1.0-1.i386.rpm

打開 MyDNS 配置文件 /etc/mydns.conf, 相對應的數據做一些調整allow-axfr to yes, enable TCP (allow-tcp = yes), and specify a recursive resolver (i.e., a valid nameserver, e.g. from your ISP; e.g. recursive = 213.191.92.86)
#vi /etc/mydns.conf

下一步啟動:

#chkconfig --levels 235 mydns on
#/etc/init.d/mydns start
打開你的IE,URL:http:///mydnsconfig/
就可以看到要你輸入用戶名和密碼.Username: admin Password: admin

5 使用MyDNSConfig

登錄:

添加新 Zone :

添加如下:
SOA
test.com.
Origin
Zone Transfers :

已添加好 你的新Zones (SOA) ,test.com.

下一個添加 Records tab:

添加新的Record button to create a record (A/MX/CNAME/...):

To create the A record www.test.com, fill in www in the Name field, select A as the Type, type in www.test.com's IP address in the Data field (e.g. 1.2.3.4), and specify the TTL (in seconds). The Preference/Priority field can be left empty for A records; it's needed for MX records:

After you've clicked on Save, you will find www.test.com in the list of records for the zone test.com:

That's it already - no restarts are required. You can now test if MyDNS can resolve www.test.com:

dig @localhost www.test.com

If all goes well, the output should look something like this:

[root@server1 ~]# dig @localhost www.test.com

; <<>> DiG 9.5.0a6 <<>> @localhost www.test.com
; (1 server found)
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 55393
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;www.test.com. IN A

;; ANSWER SECTION:
www.test.com. 86400 IN A 1.2.3.4

;; Query time: 24 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Dec 3 23:47:14 2007
;; MSG SIZE rcvd: 46

[火星人 ] 在Fedora 8上安裝MYDNS管理器已經有563次圍觀

http://coctec.com/docs/linux/show-post-168161.html