邮件服务器2以及lvm1

 1、邮件服务器 使用[email protected][email protected]用户发一封邮件,内容为you jump,i jump.

两台虚拟机:rhel7、rhel8.2

两台虚拟机均需要做的操作:

(1)安装包、分别创建rose、jack用户:

[[email protected] ~]# yum install postfix -y

[[email protected] ~]# yum install dovecot -y

[[email protected] ~]# yum install cyrus-sasl* -y

(2)配置文件内容:

[[email protected] ~]# vim /etc/postfix/main.cf

 myhostname = mail.qq(163).com

 mydomain = qq(163).com

 myorigin = $mydomain

 inet_interfaces = all

 mydestination = $myhostname, $mydomain

 mynetworks = 192.168.38.0/24

 relay_domains = $mydestination

开启SASL认证:

broken_sasl_auth_clients = yes

smtpd_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination

 

[[email protected] ~]# vim /etc/dovecot/dovecot.conf

protocols = imap pop3 lmtp

login_trusted_networks = 192.168.38.0/24

[[email protected] ~]# vim /etc/dovecot/conf.d/10-mail.conf

mail_location = mbox:~/mail:INBOX=/var/mail/%u

(3)重启服务、关闭防火墙、设置权限

[[email protected] ~]# systemctl restart postfix

[[email protected] ~]# systemctl restart dovecot

[[email protected] ~]# systemctl restart saslauthd

[[email protected] ~]# systemctl stop firewalld

[[email protected] ~]# setenforce 0

[[email protected] ~]# chmod 0600 /var/mail/*

(4)配置DNS服务器(将192.168.38.129做为DNS服务器)

[[email protected] ~]# yum install bind -y

[[email protected] ~]# vim /etc/named.conf

 

 

[[email protected] ~]# vim /var/named/named.qq.com

[[email protected] ~]# vim /var/named/named.163.com

[[email protected] ~]# systemctl restart

修改两台虚拟机的DNS服务器的ip地址为自己搭建的DNS服务器地址

[[email protected] ~]# vim /etc/resolv.conf

测试结果:

2、请按下列要求创建一个新的逻辑卷: 创建一个名为 datastore 的卷组vg,卷组的PE尺寸为 16 MiB; 逻辑卷lv的名字为 database ,所属卷组为 datastore,该逻辑卷由 50 个 PE 组成; 将新建的逻辑卷格式化为 xfs 文件系统,要求系统启动时,该逻辑卷能被自动挂载到; /mnt/database 目录。

(1)创建一个名为 datastore 的卷组vg,卷组的PE尺寸为 16 MiB;

[[email protected] ~]# vgcreate -s 16M datastore /dev/sdb1 /dev/sdb5 /dev/sdc5

(2)逻辑卷lv的名字为 database ,所属卷组为 datastore,该逻辑卷由 50 个 PE 组成;

[[email protected] ~]# lvcreate -l 50 -n database datastore

(3)将新建的逻辑卷格式化为 xfs 文件系统,要求系统启动时,该逻辑卷能被自动挂载到; /mnt/database 目录。