mydns mysql_MyDNS-ng + mysql + MyDNSConfig(Web管理)

环境:Centos6.7(x64) + mydns-1.2.8.31 +MyDNSConfig-3.0.1/MyDNSConfig-1.1.0

所需包下载到 /usr/local/src

一、安装LAMP

yum install -y php php-mysql gcc mysql mysql-server mysql-devel httpd httpd-devel php-mbstring mysql-connector-odbc

chkconfig httpd on;

chkconfig mysql on;

service mysqld start

设置mysql root密码

mysql

mysql> use mysql;

mysql> update user set password=password('mima_123456') where user='root';

mysql> flush privileges;

mysql> quit

二、安装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

#创建mydns启动脚本

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

####

chmod +x /etc/init.d/mydns

cp /usr/local/src/mydns-1.2.8.31/mydns.conf /etc

useradd -M -s /sbin/nologin mydns    创建运行mydns的帐号

修改 /etc/mydns.conf 中

user = nobody  ==>修改为 user = mydns

group = nogroup ==>修改为 group = mydns

chkconfig mydns on

三、安装MyDNSConfig-3.0.1

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");

}

更改为

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

$distname = 'CentOS';

$distver = '6.7';

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

$distbaseid = 'fedora';

swriteln("Operating System: CentOS 6.7 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.

php -q install.php     #执行安装脚本

##################################################

This will start the MyDNSConfig 3 installer:

server1:/tmp/mydnsconfig/install# php -q install.php

--------------------------------------------------------------------------------

__  __       _____  _   _  _____  _____             __ _

|  \/  |     |  __ \| \ | |/ ____|/ ____|           / _(_)

| \  / |_   _| |  | |  \| | (___ | |     ___  _ __ | |_ _  __ _

| |\/| | | | | |  | | . ` |\___ \| |    / _ \| '_ \|  _| |/ _` |

| |  | | |_| | |__| | |\  |____) | |___| (_) | | | | | | | (_| |

|_|  |_|\__, |_____/|_| \_|_____/ \_____\___/|_| |_|_| |_|\__, |

__/ |                                             __/ |

|___/                                             |___/

--------------------------------------------------------------------------------

>> Initial configuration

Operating System: Debian Lenny/Sid or compatible

Following will be a few questions for primary configuration so be careful.

Default values are in [brackets] and can be accepted with .

Tap in "quit" (without the quotes) to stop the installer.

Select language (en,de) [en]:

Installation mode (standard,expert) [standard]:

Full qualified hostname (FQDN) of the server, eg server1.domain.tld  [server1.example.com]:

MySQL server hostname [localhost]:

MySQL root username [root]:

MySQL root password []:

MySQL database to create [dbmydnsconfig]:

MySQL charset [utf8]:

Configuring MyDNS

Configuring Apache

Configuring Firewall

Installing MyDNSConfig

MyDNSConfig Port [8080]:

Installing Crontab

no crontab for root

Restarting services ...

Restarting web server: apache2 ... waiting .

Installation completed.

server1:/tmp/mydnsconfig/install#

The installer automatically configures all underlying services, so no manual configuration is needed.

Afterwards you can access MyDNSConfig 3 under http://server1.example.com:8080/ or http://192.168.0.100:8080/. Log in with the username admin and the password admin (you should change the default password after your first login):

------------------------------------------------------------------------

最后可能会提示http启动失败

修改一下配置文件

#vim /etc/http/conf/httpd.conf

在该配置文件的最后三行,注释 NAMESERVER *:80  和NAMESERVER *:443两行

(如果按以上操作之后还是失败,最后一行改成Include /etc/httpd/conf/sites-enabled/*.vhost

)

注:以上执行

1、新建了数据库dbmydnsconfig,并新建了mysql帐号ispconfig,使用复杂密码

2、新建apache站点,目录 /usr/local/ispconfig (/var/www/ispconfig 软链接到 /usr/local/ispconfig/interface/web)

3、修改 /etc/mydns.conf配置中连接mysql的帐号、密码、库

再重启httpd、启动 mydns(注意:/etc/mydns.conf配置文件中确定 soa-table = dns_soa、rr-table = dns_rr)

http://ip:8080 访问

登录用户名和密码 admin

b644ec788abb1faab9bd2b9fa8d6a56e.png

四、如果想使用MyDNSConfig-1.1.0做WEB管理,安装也差不多

1、创建数据库及用户

mysql> create database mydns;

mysql> grant all on mydns.* to mydns@localhost identified by '123456';

mysql> flush privileges;

tar xvfz MyDNSConfig-1.1.0.tar.gz -C /usr/loacl/src

cd /usr/local/src/MyDNSConfig-1.1.0

mkdir /usr/share/mydnsconfig

cp -rf interface/* /usr/share/mydnsconfig/

ln -s /usr/share/mydnsconfig/web/ /var/www/html/mydns

创建域表以及记录表等,这里直接可以使用MyDNSConfig自带的脚本来快速创建

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

编辑MyDNSConfig 的配置文件

#vim /usr/share/mydnsconfig/lib/config.inc.php(修改认证密码即可)

$conf["db_type"] = 'mysql';

$conf["db_host"] = 'localhost';

$conf["db_database"] = 'mydns';

$conf["db_user"] = 'mydns';

$conf["db_password"] = '123456';

注:如果安装目录与上面的不一样,修改 $conf["rootpath"]的值

修改/etc/mydns.conf 连接数据库信息(db-host、db-user、db-password)

最后启动httpd、mydns

acba18aeeef608d58ee2b720f4bb2e32.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值