二下源码安装mysql,在linux系统下安装DNS服务器bind

By admin in 美高梅手机版4858 on 2019年4月18日

/etc/rc.d/rc.local

BIND是1种开源的DNS(Domain Name
System)协议的落到实处,包括对域名的询问和响应所需的享有软件。它是网络上最普及选取的1种DNS服务器,上边解说在linux系统下怎么设置DNS服务器bind。

在linux系统下安装DNS服务器bind

centos 陆.二下源码安装mysql 5.5.2二

 

1.从
.二叁,源文件为bind-玖.二.3.tar.gz。
二.将源文件bind-9.二.三.tar.gz置于/usr/local/src目录下。
三.解压缩源文件bind-9.二.3.tar.gz
# tar -xzvf bind-9.2.3.tar.gz -C /usr/local/src
四.跻身安装目录
# cd bind-9.2.3
5.配置、编译
# ./configure
# make
6.安装
# make install
7.生成的可施行文件位于/usr/local/sbin目录下。最要害的可实行文件为named和rndc。
捌.成立链接
# ln -s /usr/local/sbin/rndc /usr/sbin/rndc
# ln -s /usr/local/sbin/named /usr/sbin/named
玖.创办rndc.conf配置文件。
# /usr/local/sbin/rndc-confgen > /etc/rndc.conf
# cat /etc/rndc.conf
输出为:
# Start of rndc.conf
key “rndc-key” {
二下源码安装mysql,在linux系统下安装DNS服务器bind。algorithm hmac-md5;
secret “y9xvvfQjdWv9f/Fo7wquBg==”;
};
options {
default-key “rndc-key”;
default-server 127.0.0.1;
default-port 953;
};
# End of rndc.conf
# Use with the following in named.conf, adjusting the allow list as
needed:
# key “rndc-key” {
# algorithm hmac-md5;
# secret “y9xvvfQjdWv9f/Fo7wquBg==”;
# };
#
# controls {
# inet 127.0.0.1 port 953
# allow { 127.0.0.1; } keys { “rndc-key”; };
# };
# End of named.conf
拾.创设rndc.key文件。将rndc.conf文件中注释部分拷贝生成如下文件:
# vi /etc/rndc.key
key “rndc-key” {
algorithm hmac-md5;
secret “y9xvvfQjdWv9f/Fo7wquBg==”;
};
controls {
inet 127.0.0.1 port 953
allow { 127.0.0.1; } keys { “rndc-key”; };
};
自笔者批评rndc是或不是正规干活:
#/usr/local/sbin/named -g
Jan 11 11:56:45.075 starting BIND 9.2.3 -g
Jan 11 11:56:45.076 using 1 CPU
Jan 11 11:56:45.079 loading configuration from ‘/etc/named.conf’
……
#/usr/local/sbin/rndc status
1一.创造named.conf配置文件。
# vi /etc/named.conf
// generated by named-bootconf.pl
options {
directory “/var/named”;
/*
* If there is a firewall between you and nameservers you want
* to talk to, you might need to uncomment the query-source
* directive below. Previous versions of BIND always asked
* questions using port 53, but BIND 8.1 uses an unprivileged
* port by default.
*/
// query-source address * port 53;
};
//
// a caching only nameserver config
//
zone “.” IN {
type hint;
file “named.root”;
};
zone “localhost” IN {
type master;
file “localhost.zone”;
allow-update { none; };
};
zone “0.0.127.in-addr.arpa” IN {
type master;
file “named.local”;
allow-update { none; };
};
zone “domain1.net” IN { //新加domain1.net的域
type master;
file “domain1.net.zone”;
allow-update { none; };
};
zone “25二.17七.61.in-addr.arpa” IN { //新加域的反向解析
type master;
file “named.61.177.252”;
allow-update { none; };
};
include “/etc/rndc.key”;
12.创建/var/named目录
# mkdir /var/named
# cd /var/named
1叁.匿名登6到ftp站点FTP.RS.INTERNIC.NET,获取/domain目录下的named.root文件和named.ca文件,将该文件置于/var/named目录下。
14.创建localhost.zone文件
# vi /var/named/localhost.zone
$TTL 86400
$ORIGIN localhost.
@ 1D IN SOA @ root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D ) ; minimum
1D IN NS @
1D IN A 127.0.0.1
15.创建named.local文件
# vi named.local
$TTL 86400
@ IN SOA localhost. root.localhost. (
1997022700 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
1 IN PTR localhost.
16.创建domain1.net.zone文件
# vi ycmail.net.zone
$TTL 86400
@ IN SOA localhost. root.localhost. (
2003061800 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
mail IN A 61.177.252.34
www IN CNAME mail
17.创建named.61.177.252文件
# vi named.61.177.252
$TTL 86400
@ IN SOA localhost. root.localhost. (
2003061800 ; Serial
28800 ; Refresh
14400 ; Retry
3600000 ; Expire
86400 ) ; Minimum
IN NS localhost.
34 IN PTR mail.domain1.net.
18.创建运行脚本
# vi /etc/rc.d/init.d/named
#!/bin/sh
#
# named This shell script takes care of starting and stopping
# named (BIND DNS server).
#
# chkconfig: 345 55 45
# description: named (BIND) is a Domain Name Server (DNS)
# that is used to resolve host names to IP addresses.
# probe: true
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ $ = “no” ] && exit 0
[ -f /usr/sbin/named ] || exit 0
[ -f /etc/named.conf ] || exit 0
# See how we were called.
case “” in
start)
# Start daemons.
echo -n “Starting named: “
daemon named
echo
touch /var/lock/subsys/named
;;
stop)
# Stop daemons.
echo -n “Shutting down named: “
killproc named
rm -f /var/lock/subsys/named
echo
;;
status)
/usr/sbin/rndc status
exit $?
;;
restart)
stop
start
exit $?
;;
reload)
/usr/sbin/rndc reload
exit $?
;;
probe)
# named knows how to reload intelligently; we don’t want linuxconf
# to offer to restart every time
/usr/sbin/rndc reload >/dev/null 2>&1 || echo start
exit 0
;;
*)
echo “Usage: named “
exit 1
esac
exit 0
1玖.将/etc/rc.d/init.d/named变为可执行文件。
# chmod 755 /etc/rc.d/init.d/named
20.开立运营脚本symbollink
# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc0.d/K45named
# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc1.d/K45named
# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc2.d/K45named
# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc3.d/S55named
# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc4.d/S55named
# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc5.d/S55named
# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc6.d/K45named
21.启动bind9
# /etc/rc.d/init.d/named start
停止bind9
# /etc/rc.d/init.d/named stop
翻开情状
# /etc/rc.d/init.d/named status
2二.反省安插文件及域文件
# /usr/local/sbin/named-checkconf
# /usr/local/sbin/named-checkzone domain1.net
/var/named/domain1.net.zone

 

一.安装mysql 相关正视库(未有的话就设置,有就无须安装了)

JAVA_HOME=/usr/java/jdk1.6.0_45

美高梅手机版4858 1

BIND是一种开源的DNS(Domain Name
System)协议的完毕,包罗对域名的询问和响应所需的保有软件。它是网络上最普及利用的壹种DNS服务器,上面讲明在linux系统下什么设置DNS服务器bind。

由此 rpm -qa | grep name 的办法注脚以下软件包是还是不是已总体设置。
gcc* gcc-c++* autoconf* automake* zlib* libxml* ncurses-devel*
libmcrypt* libtool*

su – goldsign -c
‘/home/goldsign/Oracle/Middleware/user_projects/domains/base_domain/startWebLogic.sh’

1.从
.二叁,源文件为bind-九.二.三.tar.gz。 

并未有的话安装:

touch /var/lock/subsys/local

二.将源文件bind-九.2.三.tar.gz置于/usr/local/src目录下。 

yum安装:

iptables -F

三.解压缩源文件bind-九.二.三.tar.gz 

#yum install bison gcc gcc-c++ autoconf automake zlib* libxml*
ncurses-devel libtool

# tar -xzvf bind-9.2.3.tar.gz -C /usr/local/src 

rpm –ivh安装:

肆.进去安装目录   www.贰cto.com  

例如:rpm -ivh MySQL-devel-4.0.24-0.i386.rpm

# cd bind-9.2.3 

2.安装cmake包

5.配置、编译 

# wget

# ./configure 

# tar zxvf cmake-2.8.6.tar.gz

# make 

# cd cmake-2.8.6/

6.安装 

# ./configure

# make install 

# gmake

七.生成的可执行文件位于/usr/local/sbin目录下。最根本的可实行文件为named和rndc。 

# gmake install

捌.创制链接 

三.增加用户和成立数据库目录和权杖设置

# ln -s /usr/local/sbin/rndc /usr/sbin/rndc 

#group add mysql

# ln -s /usr/local/sbin/named /usr/sbin/named 

#useradd mysql –g mysql

玖.开立rndc.conf配置文件。 

# mkdir -p /data/mysql

# /usr/local/sbin/rndc-confgen > /etc/rndc.conf 

# chown -R mysql:mysql /data/mysql

# cat /etc/rndc.conf 

4.MYSQL 5.5.22安装

输出为: 

#cd /usr/local/src

# Start of rndc.conf 

# wget

key “rndc-key” { 

# tar zxvf mysql-5.5.22.tar.gz

algorithm hmac-md5; 

# cd mysql-5.5.22

secret “y9xvvfQjdWv9f/Fo7wquBg==”; 

# cmake-DCMAKE_INSTALL_PREFIX=/usr/local/mysql
-DSYSCONFDIR=/etc-DMYSQL_DATADIR=/mysql/data
-DMYSQL_TCP_PORT=3306-DMYSQL_UNIX_ADDR=/tmp/mysqld.sock
-DMYSQL_USER=mysql

}; 

# gmake

options { 

# gmake install

default-key “rndc-key”; 

伍.安装mysql配置文件

default-server 127.0.0.1; 

# cd /usr/local/mysql

default-port 953; 

# cp ./support-files/my-huge.cnf/etc/my.cnf

}; 

5.1编辑/etc/my.cnf

# End of rndc.conf 

# vi /etc/my.cnf

# Use with the following in named.conf, adjusting the allow list as
needed: 

在 [mysqld]段增加

# key “rndc-key” { 

datadir = /data/mysql

# algorithm hmac-md5; 

wait-timeout = 30

# secret “y9xvvfQjdWv9f/Fo7wquBg==”; 

max_connections = 512

# };   www.2cto.com  

max_connect_errors = 10000000

default-storage-engine = MyISAM

# controls { 

在 [mysqld]段修改

# inet 127.0.0.1 port 953 

max_allowed_packet = 16M

# allow { 127.0.0.1; } keys { “rndc-key”; }; 

[mysqld_safe]日增字段

# }; 

log-error=/data/mysql/log/mysqld.log

# End of named.conf 

陆.初始化数据库

10.创制rndc.key文件。将rndc.conf文件中注释部分拷贝生成如下文件: 

#cd /usr/local/mysql

# vi /etc/rndc.key 

# 9./scripts/mysql_install_db
–datadir=/data/mysql–basedir=/usr/local/mysql–defaults-file=/etc/my.cnf
–user=mysql

key “rndc-key” { 

# cp ./support-files/mysql.server/etc/rc.d/init.d/mysqld

algorithm hmac-md5; 

# chmod 755 /etc/rc.d/init.d/mysqld

secret “y9xvvfQjdWv9f/Fo7wquBg==”; 

# chkconfig –add mysqld

}; 

# chkconfig –level 35 mysqld on

controls { 

7.设置运维脚本变量

美高梅手机版4858 ,inet 127.0.0.1 port 953 

编辑 /etc/rc.d/init.d/mysqld

allow { 127.0.0.1; } keys { “rndc-key”; }; 

# vi /etc/rc.d/init.d/mysqld

}; 

basedir=/usr/local/mysql

反省rndc是不是健康办事: 

datadir=/data/mysql

#/usr/local/sbin/named -g 

8.安装变量环境

Jan 11 11:56:45.075 starting BIND 9.2.3 -g 

# echo”PATH=$PATH:/usr/local/mysql/bin” >>
/etc/profile(恒久生效)

Jan 11 11:56:45.076 using 1 CPU 

# export PATH=$PATH:/usr/local/mysql/bin(当前收效)

Jan 11 11:56:45.079 loading configuration from ‘/etc/named.conf’ 

或者

…… 

# . /etc/profile

#/usr/local/sbin/rndc status 

九.运行服务

1一.创制named.conf配置文件。 

# service mysqld start

# vi /etc/named.conf 

10.装置数据库管理员root密码 重新启航mysqld服务

// generated by named-bootconf.pl 

# mysqladmin -u root password ‘123456’

options {   www.2cto.com  

# service mysqld restart

directory “/var/named”; 

查看mysql服务:

/* 

[[email protected]
data]#netstat-npalt | grep 3306

* If there is a firewall between you and nameservers you want 

tcp0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 25051/mysqld

* to talk to, you might need to uncomment the query-source 

查看mysql进程

* directive below. Previous versions of BIND always asked 

[[email protected]
data]#ps -ef | grep “mysql”

* questions using port 53, but BIND 8.1 uses an unprivileged 

root24737 1 0 08:04 pts/1 00:00:00
/bin/sh/usr/local/mysql/bin/mysqld_safe
–datadir=/data/mysql–pid-file=/data/mysql/tata.domain.pid

* port by default. 

mysql25051 24737 0 08:04 pts/1 00:00:00
/usr/local/mysql/bin/mysqld–basedir=/usr/local/mysql
–datadir=/data/mysql–plugin-dir=/usr/local/mysql/lib/plugin
–user=mysql–log-error=/data/mysql/tata.domain.err
–pid-file=/data/mysql/tata.domain.pid–socket=/tmp/mysqld.sock
–port=3306

*/ 

root25130 2648 0 08:24 pts/1 00:00:00 mysql -u root -p

// query-source address * port 53; 

root25183 9149 0 08:34 pts/2 00:00:00 grep mysql

}; 

11.进入Mysql

// 

# mysql -u root -p

// a caching only nameserver config 

输入密码

// 

mysql> show databases;

zone “.” IN { 

+———————–+

type hint; 

| Database |

file “named.root”; 

+———————–+

}; 

| information_schema |

zone “localhost” IN { 

| mysql |

type master; 

| #mysql50#mysql-5.5.22 |

file “localhost.zone”; 

| performance_schema |

allow-update { none; }; 

| test |

}; 

+———————–+

zone “0.0.127.in-addr.arpa” IN { 

5 rows in set (0.00 sec)

type master; 

mysql> use mysql;

file “named.local”; 

Database changed

allow-update { none; }; 

mysql> show tables;

};   www.2cto.com  

+—————————+

zone “domain1.net” IN { //新加domain1.net的域 

| Tables_in_mysql |

type master; 

+—————————+

file “domain1.net.zone”; 

| columns_priv |

allow-update { none; }; 

……..

}; 

11.管理mysql ,建表,建库

zone “25二.17柒.陆一.in-addr.arpa” IN { //新加域的反向解析 

来得mysql存款和储蓄引擎

type master; 

mysql>showengines;

file “named.61.177.252”; 

编码格局更换
show variables like ‘character_set_%’;
setcharacter_set_client=utf8;

allow-update { none; }; 

六.二下源码安装mysql 五.5.2二 一.安装mysql
相关注重库(未有的话就安装,有就无须安装了) 通过 rpm -qa | grep name
的诀窍注明以下软件包是或不是…

}; 

include “/etc/rndc.key”; 

12.创建/var/named目录 

# mkdir /var/named 

# cd /var/named 

一三.匿名登陆到ftp站点FTP.HighlanderS.INTE奥迪Q3NIC.NET,获取/domain目录下的named.root文件和named.ca文件,将该公文置于/var/named目录下。 

14.创建localhost.zone文件 

# vi /var/named/localhost.zone 

$TTL 86400 

$ORIGIN localhost. 

@ 1D IN SOA @ root ( 

42 ; serial (d. adams) 

3H ; refresh 

15M ; retry 

1W ; expiry 

1D ) ; minimum 

1D IN NS @ 

1D IN A 127.0.0.1 

15.创建named.local文件 

# vi named.local 

$TTL 86400 

@ IN SOA localhost. root.localhost. ( 

1997022700 ; Serial   www.2cto.com  

28800 ; Refresh 

14400 ; Retry 

3600000 ; Expire 

86400 ) ; Minimum 

IN NS localhost. 

1 IN PTR localhost. 

16.创建domain1.net.zone文件 

# vi ycmail.net.zone 

$TTL 86400 

@ IN SOA localhost. root.localhost. ( 

2003061800 ; Serial 

28800 ; Refresh 

14400 ; Retry 

3600000 ; Expire 

86400 ) ; Minimum 

IN NS localhost. 

mail IN A 61.177.252.34 

www IN CNAME mail 

17.创建named.61.177.252文件 

# vi named.61.177.252 

$TTL 86400 

@ IN SOA localhost. root.localhost. ( 

2003061800 ; Serial 

28800 ; Refresh 

14400 ; Retry 

3600000 ; Expire 

86400 ) ; Minimum 

IN NS localhost. 

34 IN PTR mail.domain1.net. 

1八.开立运行脚本 

# vi /etc/rc.d/init.d/named 

#!/bin/sh   www.2cto.com  

# named This shell script takes care of starting and stopping 

# named (BIND DNS server). 

# chkconfig: 345 55 45 

# description: named (BIND) is a Domain Name Server (DNS) 

# that is used to resolve host names to IP addresses. 

# probe: true 

# Source function library. 

. /etc/rc.d/init.d/functions 

# Source networking configuration. 

. /etc/sysconfig/network 

# Check that networking is up. 

[ $ = “no” ] && exit 0 

[ -f /usr/sbin/named ] || exit 0 

[ -f /etc/named.conf ] || exit 0 

# See how we were called. 

case “” in 

start) 

# Start daemons. 

echo -n “Starting named: ” 

daemon named 

echo 

touch /var/lock/subsys/named 

;; 

stop) 

# Stop daemons. 

echo -n “Shutting down named: ” 

killproc named 

rm -f /var/lock/subsys/named 

echo   www.2cto.com  

;; 

status) 

/usr/sbin/rndc status 

exit $? 

;; 

restart) 

stop 

start 

exit $? 

;; 

reload) 

/usr/sbin/rndc reload 

exit $? 

;; 

probe) 

# named knows how to reload intelligently; we don’t want linuxconf 

# to offer to restart every time 

/usr/sbin/rndc reload >/dev/null 2>&1 || echo start 

exit 0 

;; 

*) 

echo “Usage: named ” 

exit 1 

esac 

exit 0 

1九.将/etc/rc.d/init.d/named产生可执行文件。 

# chmod 755 /etc/rc.d/init.d/named 

20.创立运营脚本symbollink 

# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc0.d/K45named 

# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc1.d/K45named 

# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc2.d/K45named 

# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc3.d/S55named 

# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc4.d/S55named 

# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc5.d/S55named 

# ln -s /etc/rc.d/init.d/named /etc/rc.d/rc6.d/K45named 

21.启动bind9   www.2cto.com  

# /etc/rc.d/init.d/named start 

停止bind9 

# /etc/rc.d/init.d/named stop 

翻看情形 

# /etc/rc.d/init.d/named status 

2二.反省布署文件及域文件 

# /usr/local/sbin/named-checkconf 

# /usr/local/sbin/named-checkzone domain1.net
/var/named/domain1.net.zone 

 

 

正文来源护卫神网

BIND是1种开源的DNS(Domain Name
System)协议的贯彻,包涵对域名的询问和响应所需的享有软件。它是网络上…

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图
Copyright @ 2010-2019 美高梅手机版4858 版权所有