Sometimes, a company needs to manage many domain names. The correspondence between these domain names and ip addresses often changes, and the background operator is not a linux User. The following documents will meet this requirement.
Install the LAMP \ Vsftpd \ Webmin \ phpMyAdmin service and settings in Ubuntu 13.04
Compile and install LAMP in CentOS 5.9 (Apache 2.2.44 + MySQL 5.6.10 + PHP 5.4.12)
Source code for Web server architecture in RedHat 5.4 build the LAMP environment and application PHPWind
Build a WEB Server Linux + Apache + MySQL + PHP in the LAMP source code Environment
1. Install the lamp Environment
Yum install mysql-server php * httpd
/Etc/init. d/mysqld start
/Etc/init. d/httpd start
2. Install the bind Service
Tar zxvf bind-9.9.5.tar.gz-C/usr/src/
./Configure-prefix =/usr/local/named-with-dlz-mysql-without-ssl-enable-threads
Make & make install
3. Configure the bind Service and mysql database
Configure bind:
/Usr/local/named/sbin/rndc-confgen>/usr/local/named/etc/rndc. conf
Cd/usr/local/named/etc/
Tail-10 rndc. conf | head-9 | sed s/# \ // g> named. conf
Vi named. conf # Add the following content at the end
Dlz "DLZ use MySQL "{
Database "mysql
{Host = 127.0.0.1 dbname = named ssl = false user = named pass = 123123}
{Select zone from dns_records where zone = '$ zone $ '}
{Select ttl, type, mx_priority, case when lower (type) = 'txt 'then concat ('\ "', data, '\"') when lower (type) = 'soa 'then concat_ws ('', data, resp_person, serial, refresh, retry, expire, minimum)
Else data end from dns_records where zone = '$ zone $' and host = '$ record $ '}";
};
Note: Do not write the host name for host = 127.0.0.1. Otherwise, an error will be reported. dbname indicates the database name, user indicates the data user, and pass indicates the password. Select is an SQL statement used for query and resolution.
Create a database:
This is a file that can be exported after the database is created. You can use vi to create the named. SQL file.
[Root @ ns ~] # Cat named. SQL
-- MySQL dump 10.13 Distrib 5.1.55, for unknown-linux-gnu (x86_64)
--
-- Host: localhost Database: named
--------------------------------------------------------
-- Server version 5.1.55-log
/*! 40101 SET @ OLD_CHARACTER_SET_CLIENT = @ CHARACTER_SET_CLIENT */;
/*! 40101 SET @ OLD_CHARACTER_SET_RESULTS = @ CHARACTER_SET_RESULTS */;
/*! 40101 SET @ OLD_COLLATION_CONNECTION = @ COLLATION_CONNECTION */;
/*! 40101 set names utf8 */;
/*! 40103 SET @ OLD_TIME_ZONE = @ TIME_ZONE */;
/*! 40103 SET TIME_ZONE = '+ '*/;
/*! 40014 SET @ OLD_UNIQUE_CHECKS =@ UNIQUE_CHECKS, UNIQUE_CHECKS = 0 */;
/*! 40014 SET @ OLD_FOREIGN_KEY_CHECKS = @ FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS = 0 */;
/*! 40101 SET @ OLD_ SQL _MODE = @ SQL _MODE, SQL _MODE = 'no _ AUTO_VALUE_ON_ZERO '*/;
/*! 40111 SET @ OLD_ SQL _NOTES = SQL _notes, SQL _NOTES = 0 */;
--
-- Current Database: 'named'
--
Create database /*! 32312 if not exists */'named '/*! 40100 default character set latin1 */;
USE 'named ';
--
-- Table structure for table 'dns _ records'
--
Drop table if exists 'dns _ records ';
/*! 40101 SET @ saved_cs_client = @ character_set_client */;
/*! 40101 SET character_set_client = utf8 */;
Create table 'dns _ records '(
'Zone 'text,
'Host' text,
'Type' text,
'Data' text not null,
'Ttl 'int (11) default null,
'Mx _ priority 'text,
'Refresh' int (11) default null,
'Retry' int (11) default null,
'Expire 'int (11) default null,
'Minimum 'int (11) default null,
'Serial' bigint (20) default null,
'Resp _ person' text,
'Primary _ ns' text
) ENGINE = MyISAM default charset = latin1;
/*! 40101 SET character_set_client = @ saved_cs_client */;
--
-- Dumping data for table 'dns _ records'
--
Lock tables 'dns _ records' WRITE;
/*! 40000 alter table 'dns _ records' disable keys */;
Insert into 'dns _ records 'VALUES ('linuxfan. cn ', 'ns', 'A', '123. 168.8.79 ', 800, NULL, NULL, 10, NULL );
/*! 40000 alter table 'dns _ records 'enable keys */;
Unlock tables;
--
-- Table structure for table 'xfr _ table'
--
Drop table if exists 'xfr _ table ';
/*! 40101 SET @ saved_cs_client = @ character_set_client */;
/*! 40101 SET character_set_client = utf8 */;
Create table 'xfr _ table '(
'Zone 'text,
'Client' text
) ENGINE = MyISAM default charset = latin1;
/*! 40101 SET character_set_client = @ saved_cs_client */;
--
-- Dumping data for table 'xfr _ table'
--
Lock tables 'xfr _ table' WRITE;
/*! 40000 alter table 'xfr _ table' disable keys */;
/*! 40000 alter table 'xfr _ table' enable keys */;
Unlock tables;
/*! 40103 SET TIME_ZONE = @ OLD_TIME_ZONE */;
/*! 40101 SET SQL _MODE = @ OLD_ SQL _MODE */;
/*! 40014 SET FOREIGN_KEY_CHECKS = @ OLD_FOREIGN_KEY_CHECKS */;
/*! 40014 SET UNIQUE_CHECKS = @ OLD_UNIQUE_CHECKS */;
/*! 40101 SET CHARACTER_SET_CLIENT = @ OLD_CHARACTER_SET_CLIENT */;
/*! 40101 SET CHARACTER_SET_RESULTS = @ OLD_CHARACTER_SET_RESULTS */;
/*! 40101 SET COLLATION_CONNECTION = @ OLD_COLLATION_CONNECTION */;
/*! 40111 SET SQL _NOTES = @ OLD_ SQL _NOTES */;
-- Dump completed on 2014-03-22 17:52:53
[Root @ ns ~] #
Create data named and grant permissions
Mysqladm-uroot password 123123 # change the password for mysql root
Mysql-uroot-p123123
Create database named;
Grant all on named. * to 'named' @ '192. 0.0.1 'identified by '20140901'; # The password must be consistent with that in named. conf.
Flush privileges;
Quit;
[Root @ ns ~] # Mysql-uroot-p123123--database named <named. SQL # import a database
4. Start the named service
/Usr/local/named/sbin/named-gc/usr/local/named/etc/named. conf &
Netstat-uptln | grep named
[Root @ ns ~] # Cat/etc/resolv. conf # specify the dns Service
Search linuxfan.cn
Nameserver 192.168.8.79
[Root @ ns ~] #/Usr/local/named/bin/nslookup ns.linuxfan.cn
Server: 192.168.8.79
Address: 192.168.8.79 #53
Name: ns.linuxfan.cn
Address: 192.168.8.79
The test is successful.
5. For additional settings, install phpmyadmin as the dns backend management. If you are not familiar with the database, check it out.
PhpMyAdmin-3.3.10-all-languages.tar.gz software package, pay attention to install php5.3. You can use phpmyadmin-2.11.11.3-all-languages.tar.gz to install php sdk if it is not 5.3.
The command is as follows:
Tar zxvf phpmyadmin-3.3.10-all-languages.tar.gz-C/usr/src/
Cd/usr/src/
Music phpMyAdmin-3.3.10-all-languages // var/www/html/phpmyadm
Cd/var/www/html/phpmyadm
Cp config. sample. inc. php config. inc. php # create a configuration file
Use a browser to log on:
PhpMyAdmin details: click here
PhpMyAdmin: click here
Recommended reading:
Install the LAMP \ Vsftpd \ Webmin \ phpMyAdmin service and settings in Ubuntu 13.04
Example of LAMP architecture collaborative application-phpMyAdmin
PhpMyAdmin and Wordpress for LAMP applications
PhpMyAdmin logon timeout Solution