Use mydns + mysql + myconfig to visually manage dns servers

Source: Internet
Author: User
Tags php write

In the previous blog, I spoke about the use of powerDNS. Today, I want to talk about the configuration and usage of mydns. There are many mydns configurations on the Internet, but the web management of myconfig will be explained later in the editor). Of course, since the editor mentioned this, there must be a solution, the solution is detailed in the subsequent implementation steps. Let's get started with mydns.

Step 1: system environment and software requirements

Red hat enterprise linux 5.4

Mydns-1.1.0.tar.bz2

Mysql-5.6.10.tar.gz cmake-2.8.10.2.tar.gz for compiling mysql source code)

Apache server and related components

MyDNSConfig-1.1.0.tar.gz for web Management)

Step 2: Because the mydns domain and record information are based on the mysql database, install the mysql database first, because the mysql version included in the original linux 5.4 is too low, here small make up download a latest version of The mysql-5.6.10, as to the installation process of small make up the original has a blog has a detailed description, if you do not want to see the small make up here a tired of attachment it

Decompress the source code files of mysql and cmake to the/usr/local/src folder.

# Tar-zxvf mysql-5.6.10.tar.gz-C/usr/local/src/

# Tar-zxvf cmake-2.8.10.2.tar.gz-C/usr/local/src

Switch to the cmake directory

# Cd/usr/local/src/cmake-2.8.10.2/

Run the following commands according to the installation instructions:

#./Bootstrap

# Make

# Make install

Then, use which cmake to check whether cmake is successfully installed.

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image002 "border =" 0 "alt =" clip_image002 "height =" 38 "src =" http://www.bkjia.com/uploads/allimg/131228/0201394031-0.jpg "/>

Then install mysql. Switch to the mysql source code to unzip the directory.

# Cd/usr/local/src/mysql-5.6.10/

Then run # cmake.

Run # make & make install

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image004 "border =" 0 "alt =" clip_image004 "height =" 256 "src =" http://www.bkjia.com/uploads/allimg/131228/02013a5I-1.jpg "/>

The execution process is quite long ........

Add a mysql user first

#Groupadd mysql
# Useradd-r-g mysql

Mysql is automatically installed in the/usr/local/mysql directory. Then, modify the user and user group.

# Chown-R mysql. mysql/usr/local/mysql

Switch to the script directory

# Cd/usr/local/mysql/scripts

Execute subsequent scripts

#./Mysql_install_db -- user = mysql -- basedir =/usr/local/mysql -- datadir =/usr/local/mysql/data

Then place the corresponding configuration file in the/usr/local/mysql/support-files) cp to the/etc directory.

# Cd/usr/local/mysql/support-files

# Cp mysql. server/etc/rc. d/init. d/mysql Command Control

# Cp my-default.cnf/etc/my. cnf

Then modify the mysql startup level.

# Chkconfig -- add mysql

# Chkconfig -- level 35 mysql on

Start mysql

# Service mysql start

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image006 "border =" 0 "alt =" clip_image006 "height =" 54 "src =" http://www.bkjia.com/uploads/allimg/131228/02013a591-2.jpg "/>

Use mysql

/Usr/local/mysql/bin/mysql

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image008 "border =" 0 "alt =" clip_image008 "height =" 181 "src =" http://www.bkjia.com/uploads/allimg/131228/0201392613-3.jpg "/>

Check the status. The installation is successful.

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image010 "border =" 0 "alt =" clip_image010 "height =" 326 "src =" http://www.bkjia.com/uploads/allimg/131228/02013a9A-4.jpg "/>,

Step 3: install and configure mydns

Decompress the mydns-1.1.0.tar.gz and switch to the decompressed directory

# Tar-zxvf mydns-1.1.0.tar.gz-C/usr/local/src

# Cd/usr/local/src/mydns-1.1.0

There are three steps for installation, and the next step will be prompted after each step is completed)

#./Configure -- prefix =/usr/local/mydns indicates the installation path)
# Make
# Make install

# Make conf is critical to generating a configuration file.

Add a mydns user

# Useradd mydns

# Passwd mydns Password Changed to 123456

Edit mydns. conf

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image012 "border =" 0 "alt =" clip_image012 "height =" 154 "src =" http://www.bkjia.com/uploads/allimg/131228/0201391416-5.jpg "/>

Because no database has been created for mydns yet. Although the configuration file is named, log on to mysql to create the mydns background database.

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image014 "border =" 0 "alt =" clip_image014 "height =" 230 "src =" http://www.bkjia.com/uploads/allimg/131228/0201394K9-6.jpg "/>

If you cannot log on to/usr/local/mysql/bin/mysql-u-root-p, use

/Usr/local/mysql/bin/mysql

Mysql> create database mydns;
Mysql> grant all on mydns. * to mydns @ localhost identified by mysql> '123 ';
Mysql> flush privileges;
Mysql> quit;

After the database is created, the reader will think that the next step is to create the corresponding table structure, but let me remind you that we want to use the mydnsConfig web management tool, table creation is also involved when this management tool is configured. They are all for the database mydns. Therefore, you do not need to create a table When configuring mydns, wait until mydnsConfig is configured.

Step 4: Install the configuration MyDNSConfig-1.1.0.tar.gz

MyDNSConfig is developed based on PHP. Therefore, your server must be supported.

PHP and MySQL. The mysql editor has already been configured, that is, to configure apache and php. Here you can use the software package that comes with linux 5.4.

# Yum install httpd php-mysql php-mbstring mysql-connector-odbc

# Chkconfig -- levels 235 httpd on

# Service httpd start

Then open the browser to test

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image016 "border =" 0 "alt =" clip_image016 "height =" 467 "src =" http://www.bkjia.com/uploads/allimg/131228/0201394B7-7.jpg "/>

Install MyDNSConfig

# 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/mydnsconfig

Create a domain table and a record table. You can use the script that comes with MyDNSConfig to quickly create a record table.

# Mysql-u mydns-p mydns <install/mydnsconfig. SQL

This completes the table creation.

Edit the configuration file of MyDNSConfig

# Vim/usr/share/mydnsconfig/lib/config. inc. php (change the authentication password)

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

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

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

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

$ Conf ["db_password"] = '000000 ';

Step 5: centralized Test

First, get all the services together.

# Service mysql restart

#/Usr/local/mydns/sbin/mydns &

# Service httpd restart

Startup result

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image018 "border =" 0 "alt =" clip_image018 "height =" 158 "src =" http://www.bkjia.com/uploads/allimg/131228/0201395E0-8.jpg "/>

Next we will focus on testing on the web page. Open the browser and enter http: // 127.0.0.1/mydnsconfig/in the address bar. The following logon interface will appear.

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image020 "border =" 0 "alt =" clip_image020 "height =" 539 "src =" http://www.bkjia.com/uploads/allimg/131228/02013911b-9.jpg "/>

The default username and password are both admin. However, when you enter the username and password, you can click login to find the following scenario:

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image022 "border =" 0 "alt =" clip_image022 "height =" 539 "src =" http://www.bkjia.com/uploads/allimg/131228/0201391228-10.jpg "/>

What is the situation? Is it true that the login account and password are not admin? I have been skeptical about this issue, but this suspicion has been dispelled by my unremitting efforts, because the advantages of source code installation are, I can read the php source code of MyDNSConfig. I have carefully debugged the logon page of MyDNSConfig,

The mysql_connect () function connecting to the mysql database in the underlying php didn't get the correct result. Of course, the original code shows the error friendly. I am here to solve the problem, I wrote a simple debugging php page to display the error information, so as to solve the problem.

# Vim/var/www/html/test. php write the following content and save it

<? Php

$ Err = mysql_connect ("localhost", "root", "123456 ")

Or die ("cocould not connect:". mysql_error ());

Print ("Connected successfully ");

Mysql_close ($ err );

?>

Then, open the browser and enter http: // 127.0.0.1/test. php for testing.

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image024 "border =" 0 "alt =" clip_image024 "height =" 226 "src =" http://www.bkjia.com/uploads/allimg/131228/0201394407-11.jpg "/>

The error message is displayed. It indicates mysql cannot be found. the sock file is simple. mysql installed in the source code of the mini editor puts this file under the/tmp directory. You can link this file to the/var/lib/mysq/directory.

# Ln-s/tmp/mysql. sock/var/lib/mysql. sock

Next, let's test. Open the browser and enter http: // 127.0.0.1/mydnsconfig/again, enter the user name and password, and then click "Login". The following page is displayed:

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image026 "border =" 0 "alt =" clip_image026 "height =" 505 "src =" http://www.bkjia.com/uploads/allimg/131228/0201393049-12.jpg "/>

Click "Add New Zone". Now let's Add a domain named zzutest.com.

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image028 "border =" 0 "alt =" clip_image028 "height =" 413 "src =" http://www.bkjia.com/uploads/allimg/131228/02013960V-13.jpg "/>

Enter relevant information and click "Save"

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image030 "border =" 0 "alt =" clip_image030 "height =" 458 "src =" http://www.bkjia.com/uploads/allimg/131228/0201395360-14.jpg "/>

Click the position indicated by the mouse

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image032 "border =" 0 "alt =" clip_image032 "height =" 381 "src =" http://www.bkjia.com/uploads/allimg/131228/02013a1B-15.jpg "/>

Click Records"

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image034 "border =" 0 "alt =" clip_image034 "height =" 402 "src =" http://www.bkjia.com/uploads/allimg/131228/0201394532-16.jpg "/>

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image036 "border =" 0 "alt =" clip_image036 "height =" 394 "src =" http://www.bkjia.com/uploads/allimg/131228/0201391223-17.jpg "/>

Click "Add New Record"

There are many types of records that can be added here. The small Editor adds an ns record and three A records. The records can be viewed by type as the drop-down box in the middle.

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image038 "border =" 0 "alt =" clip_image038 "height =" 406 "src =" http://www.bkjia.com/uploads/allimg/131228/020139D33-18.jpg "/>

When "A" is selected, you can see the three A records added by xiaobian.

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image040 "border =" 0 "alt =" clip_image040 "height =" 145 "src =" http://www.bkjia.com/uploads/allimg/131228/0201393641-19.jpg "/>

When "NS" is selected, you can see an NS record added by xiaobian.

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image042 "border =" 0 "alt =" clip_image042 "height =" 87 "src =" http://www.bkjia.com/uploads/allimg/131228/0201394408-20.jpg "/>

The last step is to test the following parsing results.

650) this. width = 650; "style =" border-bottom: 0px; border-left: 0px; border-top: 0px; border-right: 0px "title =" clip_image044 "border =" 0 "alt =" clip_image044 "height =" 316 "src =" http://www.bkjia.com/uploads/allimg/131228/0201391K8-21.jpg "/>

All of them are correct. I'm done. I will teach you the exercises next. If you have any questions, please leave a message and contact me.

This article is from the post-90 blog, please be sure to keep this source http://wnqcmq.blog.51cto.com/5200614/1170326

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.