MyDNS安装
============================================================
# 环境:
Centos 6.3 X86_64
LAMP/LNMP
===========================================================
# 所需软件:
①mydns-mysql-1.1.0-1.i386.rpm //MyDNS的主程序
下载地址--》http://mydns.bboy.net/
② MyDNSConfig-3.0.1.tar.gz //通过web管理MyDNS的软件
下载地址--》http://sourceforge.net/projects/mydnsconfig/
③vlogger-1.3.tar.gz //记录MyDNS日志的工具
下载地址--》http://n0rp.chemlab.org/vlogger/
===========================================================
# 安装:
一、配置LAMP环境
使用yum安装LAMP (需要配置网络yum源或本地yum源)
友情提示:
1、请关闭主机上的SELinux以及Iptalbes服务,否则会出现各种意想不到的错误。
setenforce 0 //临时关闭SELinux
service iptables stop //临时关闭Iptalbes服务
2、采用yum安装可以自动解决各个软件包之间的依赖性
3、如果在安装MyDNSConfig时出现如下错误:
PHPNotice: Undefined offset: 0 in/usr/local/src/mydnsconfig/install/install.php on line 105
请修改你的主机名,例如:dns.example.com
①网络yum源配置
http://wangjun51.blog.51cto.com/6124567/1348492
②本地yum源配置
http://wangjun51.blog.51cto.com/6124567/1260001
③安装lamp软件
[root@dns~]#yum install httpd mysql mysql-server php php-mysql php-mbstring
④启动服务
[root@dns~]#service httpd start
[root@dns~]#chkconfig httpd on
//启动web服务并添加到开机启动
[root@dns~]#service mysqld start
[root@dns~]#chkconfig mysqld on
//启动mysql服务并添加到开机启动
二、安装MyDNS
①下载MyDNS
[root@dns~]#wget http://mydns.bboy.net/download/mydns-mysql-1.1.0-1.i386.rpm
②安装MyDNS
[root@dns~]#yum localinstall mydns-mysql-1.1.0-1.i386.rpm
③创建MyDNS所要使用的数据库
[root@dns~]#mysql -uroot -p
>create database mydns;
//创建一个名为:mydns的数据库
>grant all privileges on mydns.* to ‘mydns’@’localhost’ identified by ‘123456’
//为用户mydns授权,允许mydns用户对mydns数据库的所有操作。
>flush privileges; //刷新权限
三、安装MyDNSConfig
①解压缩源码包
[root@dns~]# tar -zxvf MyDNSConfig-3.0.1.tar.gz -C /usr/local/src/
[root@dns ~]# cd /usr/local/src/mydnsconfig/install
②修改MyDNSConfig文件
[root@dns install]# cat /etc/centos-release
[root@dns install]#vi lib/install.lib.php
友情提示:
如果对应的系统版本以及版本号不正确的话,会出现如下错误:
>> Initial configuration
PHP Notice: Undefined variable: distver in/usr/local/src/mydnsconfig/install/lib/install.lib.php on line 135
PHP Notice: Undefined variable: distid in/usr/local/src/mydnsconfig/install/lib/install.lib.php on line 135
PHP Notice: Undefined variable: distbaseid in /usr/local/src/mydnsconfig/install/lib/install.lib.phpon line 135
Linux Distribution or Version notrecognized.
[root@dns install]# php -q install.php
以下是安装MyDNSConfig的步骤:
Select language (en,de) [en]:
Installation mode (standard,expert) [standard]:
Full qualified hostname (FQDN) of the server, egserver1.domain.tld [localhost]:dns.srforce.com
MySQL server hostname [localhost]:
MySQL root username [root]:
MySQL root password []: 123456
MySQL database to create [dbmydnsconfig]: mydns
MySQL charset [utf8]:
Configuring MyDNS
Configuring Apache
Configuring Firewall
Installing MyDNSConfig
MyDNSConfig Port [8080]:
chown: invalid user: `getmail'
Installing Crontab
no crontab for root
Restarting services ...
Stopping httpd: [ OK ]
[Tue Jan 07 04:03:54 2014] [warn] NameVirtualHost*:443 has no VirtualHosts
[Tue Jan 07 04:03:54 2014] [warn] NameVirtualHost*:80 has no VirtualHosts
Starting httpd: [FAILED]
Installation completed.
③修改httpd配置文件
[root@dns ~]# vim /etc/httpd/conf/httpd.conf
//如果不定义虚拟主机,只需注释掉:
NameVirtualHost *:80
NameVirtualHost *.443
否则无法启动httpd。
④修改MyDNS配置文件
[root@dns ~]#vi /etc/mydns.conf
⑤启动MyDNS服务
[root@dns ~]#service mydns start
[root@dns ~]#netstat -tupln | grep 53
四、安装vlogger
[root@dns~]# tar -zxvf vlogger-1.3.tar.gz -C /usr/local/src/
[root@dns ~]#ln -s /usr/local/src/vlogger-1.3/vlogger /usr/sbin/vlogger
友情提示:
如果不安装的话,无法启动httpd,httpd日志报如下错误:
unable to start piped log program '/usr/sbin/vlogger -s access.log -t "%Y%m%d-access.log"/var/log/ispconfig/httpd': No such file or directory
Unable to open logs
五、安装perl-TimeDate
[root@dns~]# yum install perl-TimeDate
友情提示:
解决vlogger记录日志时测错误:
piped log program ' /usr/sbin/vlogger -saccess.log -t "%Y%m%d-access.log" /var/log/ispconfig/httpd' failedunexpectedly
Can't locate Date/Format.pm in @INC (@INCcontains: /usr/local/lib64/perl5 /usr/local/share/perl5/usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5/usr/share/perl5) at /usr/sbin/vlogger line 147.
BEGIN failed--compilation aborted at/usr/sbin/vlogger line 147.
六、测试
①登录
②添加区域信息
③为区域添加各种记录
④解析
在另外一台计算机中,设置其DNS服务器为:
10.0.19.101
[root@dns~]# cat /etc/resolv.conf
nameserver 10.0.19.101
转载于:https://blog.51cto.com/wangjun51/1349551