安装MyDNS和MyDNSConfig控制面板在Mandriva 2008.0上

在Mandriva 2008.0上安装MyDNS和MyDNSConfig控制面板

版本1.0
作者:Falko Timme

在本教程中,我将介绍如何在Mandriva 2008.0上安装和配置MyDNS和MyDNSConfig。 MyDNS是使用MySQL数据库作为后端而不是配置文件的DNS服务器,例如Bind或djbdns。 优点是MyDNS只是从数据库中读取记录,当DNS记录更改或区域被创建/编辑/删除时,不必重新启动/重新加载。 可以通过安装访问同一数据库的MyDNS的第二个实例来轻松设置辅助Nameservers,或者更多冗余,使用MySQL主/从复制功能将数据复制到辅助Nameservers。

MyDNSConfig是一个易于使用的基于Web的MyDNS界面。 MyDNSConfig可以创建MyDNS中可用的所有类型的DNS记录,并添加用户管理和访问权限等功能。

我不会保证这将为您工作!

1初步说明

在本教程中,我使用IP地址为192.168.0.100的hostname server1.example.com 。 这些设置可能会有所不同,因此您必须在适当的情况下更换它们。

2安装先决条件

MyDNSConfig是以PHP编写的MyDNS的基于Web的界面。 这需要一个启用了PHP的Web服务器和MySQL数据库服务器。 如果您已经安装了Apache,PHP和MySQL,则可以跳过此步骤。 我们还在这里安装phpMyAdmin,以便您有一个Web接口到MySQL数据库,以防您需要它:

urpmi MySQL MySQL-client phpmyadmin

默认情况下,Mandriva 2008.0 MySQL软件包中未启用网络连接。 我们可以通过在/etc/my.cnf注释掉 skip-networking来改变这一点

vi /etc/my.cnf
[...]
# Don't listen on a TCP/IP port at all. This can be a security enhancement,
# if all processes that need to connect to mysqld run on the same host.
# All interaction with mysqld must be made via Unix sockets or named pipes.
# Note that using this option without enabling named pipes on Windows
# (via the "enable-named-pipe" option) will render mysqld useless!
#
#skip-networking
[...]

之后,我们启动MySQL和Apache:

/etc/init.d/mysqld start
/etc/init.d/httpd start

为MySQL用户root创建密码(将yourrootsql密码替换为您要使用的密码):

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

现在您可以将浏览器指向http://server1.example.com/phpmyadmin/http://192.168.0.100/phpmyadmin/ ,并使用用户名root和新的root MySQL密码登录。

3安装MyDNSConfig

登录到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;

使用您选择的密码替换上述命令中的mydnspassword一词。

下载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

安装MyDNSConfig:

mkdir /usr/share/mydnsconfig
cp -rf interface/* /usr/share/mydnsconfig/
ln -s /usr/share/mydnsconfig/web/ /var/www/html/mydnsconfig

安装MyDNSConfig MySQL数据库:

mysql -u root -p mydns < install/mydnsconfig.sql

上述命令要求输入密码,请输入MySQL root用户的密码。

编辑MyDNSConfig配置; 请确保您填写正确的数据库设置:

vi /usr/share/mydnsconfig/lib/config.inc.php
<?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;
?>

之后,从/ tmp目录中删除MyDNSConfig安装程序:

cd /tmp
rm -rf MyDNSConfig-1.1.0/
rm -f MyDNSConfig-1.1.0.tar.gz
赞(52) 打赏
未经允许不得转载:优客志 » 系统运维
分享到:

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏