歡迎您光臨本站 註冊首頁

fedora 8下MyDNS的安裝(轉)

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

MyDNS是一種以MySQL資料庫為後台的DNS伺服器,它使用數據記錄的格式替代配置文件格式的傳統DNS伺服器。例如:BIND。MyDNS伺服器的安裝配置和管理更加簡單容易實現 ,而且更容易理解。與傳統和基於配置文件的DNS伺服器相比,初學者更能快速入門。MyDNS從MySQL資料庫中讀取記錄,當記錄或區域增加、修改、刪除的時候不用重新啟動、載入伺服器。MyDNSConfig是使用WEB的MyDNS配置介面,它可以創建所有類型的MyDNS記錄。
步驟:
1。配置網路介面。
在這裡我的電腦主機名為 "wkg.com",IP地址是192.168.1.102。這是個人的設置,請依照你的實際情況進行設置。
2。配置軟體環境。
MyDNSConfig 是基於PHP的基礎上開發的。所以你的伺服器一定要能支持PHP和MySQL才行。它要用到 Apache PHP和 MySQL 。(如果你已經安裝和配置好了它們的話可以跳過這一步 )在這裡你也要安裝 phpMyAdmin來管理MySQL。
2.1:安裝各種軟體:使用yum命令來安裝既可以解決依賴性問題,也可以得到更新版本的軟體。
# yum install httpd mysql-server php php-mysql php-mbstring phpMyAdmin
2.2:啟動MySQL資料庫(start mysql database)
# chkconfig --levels 235 mysqld on //讓MySQL在伺服器啟動時自動啟動
# /etc/init.d/mysqld start
2.2:設置MySQL 的root 用戶密碼
# mysqladmin -u root password yourrootsqlpassword
# mysqladmin -h wkg.com -u root password yourrootsqlpassword
2.3: 現在我們來配置 phpMyAdmin。修改Apache配置文件,允許 phpMyAdmin能通過別的主機訪問,不是只能在localhost可以訪問。(註銷掉
gedit /etc/httpd/conf.d/phpMyAdmin.conf (也可以用vi 編輯器來編輯)
修改後的phpMyAdmin.conf 如下:
[table=98%][tr][td] # 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
#

#
[/td][/tr][/table]
2.4:創建啟動項和啟動Apache
# chkconfig --levels 235 httpd on
# /etc/init.d/httpd start

現在可以在瀏覽器中打開:http://wkg.com/phpMyAdmin/ 或者 http://192.168.1.102/phpMyAdmin/ 使用你的新 root MySQL密碼登陸進去。
3 安裝MyDNSConfig (Installing MyDNSConfig)3.1 登錄MySQL和創建資料庫,創建資料庫用戶和授權
mysql -u root -p
mysql> CREATE DATABASE mydns;
mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON mydns.* TO 'mydns'@'localhost' IDENTIFIED BY 'mydnspassword';
mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON mydns.* TO 'mydns'@'localhost.localdomain' IDENTIFIED BY 'mydnspassword';
//以上兩條語句的作用是創建用戶並授權。
mysql> FLUSH PRIVILEGES;
mysql> quit;
註:mydnspassword是你新建的MySQL用戶的密碼,請根據自己的實際情況設置。
3.2 下載和安裝 MyDNSConfig:
# 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
# mkdir /usr/share/mydnsconfig

# cp -rf interface/* /usr/share/mydnsconfig/
# ln -s /usr/share/mydnsconfig/web/ /var/www/html/mydnsconfig
3.3安裝
MyDNSConfig MySQL Database(在上面的基礎上)
# mysql -u root -p mydns < install/mydnsconfig.sql
會提示輸入用戶密碼。輸入你的MySQL root 用戶密碼。即可完成對應資料庫的人創建。
3.4編輯MyDNSConfig的配置文件
gedit /usr/share/mydnsconfig/lib/config.inc.php
[table=98%][tr][td] /*
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"] = 'wkg.com.'; // must be set if $conf['auto_create_ptr'] is 1. Don't forget the trailing dot!
$conf["default_mbox"] = 'root.wkg.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;
?>[/td][/tr][/table]
3.5完成上面的設置之後從 /tmp 目錄中刪除MyDNSConfig

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

4:安裝 MyDNS
4.1 從 http://mydns.bboy.net/download/ 下載 mydns-mysql RPM包 並安裝它
wget http://mydns.bboy.net/download/mydns-mysql-1.1.0-1.i386.rpm
rpm -ivh mydns-mysql-1.1.0-1.i386.rpm
4.2 打開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)
# gedit /etc/mydns.conf
修改之後為如下:
[table=95%][tr][td] ##
## /etc/mydns.conf
## Wed Jan 18 17:18:48 2006
## For more information, see mydns.conf(5).
##


# DATABASE INFORMATION

db-host = localhost # SQL server hostname
db-user = mydns # SQL server username
db-password = mydnspassword # SQL server password
database = mydns # MyDNS database name


# GENERAL OPTIONS

user = nobody # Run with the permissions of this user
group = nobody # Run with the permissions of this group
listen = * # Listen on these addresses ('*' for all)
no-listen = # Do not listen on these addresses


# CACHE OPTIONS

zone-cache-size = 1024 # Maximum number of elements stored in the zone cache
zone-cache-expire = 60 # Number of seconds after which cached zones expires
reply-cache-size = 1024 # Maximum number of elements stored in the reply cache
reply-cache-expire = 30 # Number of seconds after which cached replies expire


# ESOTERICA

log = LOG_DAEMON # Facility to use for program output (LOG_*/stdout/stderr)
pidfile = /var/run/mydns.pid # Path to PID file
timeout = 120 # Number of seconds after which queries time out
multicpu = 1 # Number of CPUs installed on your system
recursive = 213.191.92.86 # Location of recursive resolver
allow-axfr = yes # Should AXFR be enabled?
allow-tcp = yes # Should TCP be enabled?
allow-update = no # Should DNS UPDATE be enabled?
ignore-minimum = no # Ignore minimum TTL for zone?
soa-table = soa # Name of table containing SOA records
rr-table = rr # Name of table containing RR data
soa-where = # Extra WHERE clause for SOA queries
rr-where = # Extra WHERE clause for RR queries[/td][/tr][/table]

下一步創建啟動對象,讓系統啟動時啟動MyDNS.
# chkconfig --levels 235 mydns on
# /etc/init.d/mydns start
4.3用瀏覽器打開URL:http:///mydnsconfig/
然後用默認的用戶名和密碼進行登錄,默認的用戶名和密碼是admin。可以在 System > Users修改你的用戶密碼。

[火星人 ] fedora 8下MyDNS的安裝(轉)已經有598次圍觀

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