MyDNS安装

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的数据库

wKioL1LL3CqRxtz_AABY4FXrhb4441.jpg

>grant  all  privileges   on mydns.*   to  ‘mydns’@’localhost’  identified by   ‘123456’

//为用户mydns授权,允许mydns用户对mydns数据库的所有操作。

>flush   privileges;      //刷新权限

wKiom1LL3LOQnPQ5AABDZiZStv8646.jpg

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

wKioL1LL3ROSCmTMAAAf6Q-xEHU237.jpg

[root@dns install]#vi  lib/install.lib.php

wKiom1LL3VKg4L6SAAB5Xv6lgI8418.jpg

友情提示:

如果对应的系统版本以及版本号不正确的话,会出现如下错误:

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

wKiom1LL4Z3T-9SwAABtC8uBt8c741.jpg

以下是安装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

wKiom1LL4dCwh2v5AABm02WneHk984.jpg

//如果不定义虚拟主机,只需注释掉:

NameVirtualHost *:80

NameVirtualHost *.443

否则无法启动httpd

修改MyDNS配置文件

[root@dns  ~]#vi  /etc/mydns.conf

wKioL1LL4gCzqWzgAAA7UOOd5KY886.jpg

启动MyDNS服务

[root@dns  ~]#service mydns  start

[root@dns  ~]#netstat  -tupln  | grep  53

wKiom1LL4jWAWUIlAAAmult5AJ8497.jpg

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

友情提示:

如果不安装的话,无法启动httpdhttpd日志报如下错误:

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.


六、测试

登录

wKioL1LL4raDkak0AABVo2TUNj4892.jpg

wKiom1LL4sOhhqfxAABIZ2Dlqto781.jpg

添加区域信息

wKioL1LL4reDzgZCAABvLtMJirE959.jpg

为区域添加各种记录

wKiom1LL4sOxe_NVAAB28RCz_GM307.jpg

解析

在另外一台计算机中,设置其DNS服务器为:

10.0.19.101

[root@dns~]# cat /etc/resolv.conf

nameserver  10.0.19.101

wKioL1LL4reiHgHxAACj3Uyf86A731.jpg


你可能感兴趣的:( , ,mydns,mydnsconfig,vlogger)