步骤:
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
#
#
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/sourceforge/mydnsconfig/MyDNSConfig-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
[color=black]3.3安装 [/color]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,相对应的数据库做一些调整[font=Courier New]allow-axfr[/font] to [font=Courier New]yes[/font], enable TCP ([font=Courier New]allow-tcp = yes[/font]), and specify a recursive resolver (i.e., a valid nameserver, e.g. from your ISP; e.g. [font=Courier New]recursive = 213.191.92.86[/font])
# 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://
然后用默认的用户名和密码进行登录,默认的用户名和密码是admin。可以在 System > Users修改你的用户密码。

