###ddns###
1)实现master变化,slave自动变化
master:
vim /etc/named.conf
vim /etc/named.rfc1912.zones
cd /var/named
cp -p named.localhost westos.com.zone
vim westos.com.zone
slave:
vim /etc/named.conf
vim /etc/named.rfc1912.zones
cd /var/named
cp -p named.localhost linux.com.zone
vim linux.com.zone
2)实现在slave更改master
无需密码:
master:
vim /etc/named.rfc1912.zones
chmod 775 /var/named
slave:
vim /etc/named.rfc1912.conf
用密码:
master:
cd /mnt
dnssec-keygen -a HMAC-MD5 -b 128 -n HOST westos
cp -p /etc/rndc.key /etc/haha.key
vim /etc/named.conf
vim /etc/named.rfc1912.conf
scp /mnt/* [email protected]:/mnt
slave:
cd /mnt
nsupdate -k K...
3)master上dns给slave IP和密码等信息
使slave 主机名和对应IP变化
master:
yum install dhcp -y
cp /usr/share/doc/dhcp-4.2.5/dhcpd.example.config /etc/dhcp/dhcpd.config
vim /etc/dhcp/dhcpd.conf
slave:
vim /etc/systemconfig/network-scripts/ifcfg-eth0
systemctl restart network
##数据库mariadb##
1.数据库安装
yum install mariadb mariadb-server
systemctl start mariadb
mysql_secure_installation
2.登陆
mysql -uroot -predhat
3.显示和查询
SHOW DATABASES;
CREATE DATABASE LINUX;
USE LINUX;
SHOW TABLES;
CREATE TABLE WESTOS (XING VARCHAR(8),MING VARCHAR(8));
SELECT * FROM WESTOS;
INSERT INTO WESTOS VALUES(‘L‘,‘MX‘);
ALTER TABLE WESTOS ADD CLASS VARCHAR(8);
ALTER TABLE WESTOS DROP CLASS;
DESC WESTOS;
UPDATE WESTOS SET MING=‘QINWEN‘;
DELETE FEOM WESTOS WHRER XING=‘LIU‘;
DROP TABLE WESTOS;
DROP DATABASE LINUX;
CREATE USER [email protected] identified by ‘redhat‘;
CREATE USER [email protected]‘%‘ identified by ‘redhat‘;
GRANT INSERT,UPDATE ON mysql.user to [email protected];
SHOW GRANTS FOR [email protected];
REVOKE INSERT,UPDATE ON mysql.user from [email protected];
DROP USER [email protected];
DROP USER [email protected]‘%‘;
*)忘记密码该怎样
1.systemctl stop mariadb
2.mysqld_safe --skip-grant-tables
3.mysql -uroot
4.update mysql.user set password=password(‘redhat‘);
5.ps aux |grep mysql ,kill -9 与mysql相关pid
*)数据库备份
mysqldump -uroot -predhat westos>/mnt/westos.sql
mysql -uroot -p redhat westos</mnt/westos.sql
*)用图形网页形式管理数据库
1.yum install httpd php php-mysql -y
2.systemctl start httpd
systemctl start mariadb
systemctl stop firewalld
下载 phpMyAdmin 并解压到/var/www/html,进入解压目录
3.systemctl restart httpd
cp config.sample.inc.php config.inc.php
vim config.inc.php,$cfg[‘blowfish_secret‘]=‘任意字符‘;
###邮件传输协议###
1.实验环境配置
改两台主机名为haha.westos.com,haha.linux.com
dns都改为 linux主机地址 172.25.254.127
linux主机上进行:
yum install bind -y
systemctl stop firewalld
systemctl start named
vim /etc/named.conf
vim
/etc/named.rfc1912.zones
cp -p /var/named/named.local /var/named/linux.com.zone
vim /var/named/linux.com.zone
cp -p /var/named/named.local /var/named/westos.com.zone
vim /var/named/westos.com.zone
systemctl restart named
2.postfix配置
在两台主机上修改postfix文件
vim /etc/postfix/main.cf
systemctl restart postfix
systemctl stop firewalld
3.邮件发送和接收
westos主机:
*)队列有出错邮件时 postsuper -d queueID 删除邮件
4.邮件别名和群发
在linux主机上设置
vim /etc/aliases
vim /etc/moreusers
postalias /etc/aliases
systemctl restart postfix
在westos主机上给admin和more发邮件测试
5.改变发送人名称
linux主机:
vim /etc/postfix/generic
postmap generic
postconf -e "smtp_generic_maps = hash:/etc/postfix/generic"
mail [email protected]
##telnet##