- mail邮箱服务器搭建:
[root@zhujd ~]# dnf install -y postfix dovecot cyrus-sasl
[root@zhujd ~]# vim /etc/postfix/main.cf
#如下图所示,修改文件内容,保存并退出
在最后加上下图内容
[root@zhujd ~]# vim /etc/dovecot/dovecot.conf
#如下图所示,修改文件内容,保存并退出
[root@zhujd ~]# vim /etc/dovecot/conf.d/10-mail.conf
#如下图所示,修改文件内容,保存并退出
[root@zhujd ~]# vim /etc/dovecot/conf.d/10-ssl.conf
[root@zhujd ~]# vim /etc/sysconfig/saslauthd
[root@zhujd ~]# mkdir -p /home/client1/mail/.imap/INBOX
[root@zhujd ~]# systemctl restart postfix.service
[root@zhujd ~]# systemctl restart dovecot
[root@zhujd ~]# systemctl restart saslauthd
2. samba服务器搭建
创建public共享项,path目录/opt/share,实现所有用户可读(匿名访问),
只有admin组和teacher用户可以写,并且默认创建的文件权限为644,目录为755;
[root@zhujd ~]# yum install -y samba samba-client cifs-utils
[root@zhujd ~]# vim /etc/samba/smb.conf #配置samba配置文件
#如下图所示,修改文件内容,保存并退出
#添加linux用户
[root@zhujd ~]# useradd teacher
#添加linux组
[root@zhujd ~]# groupadd admin
[root@zhujd ~]# smbpasswd -a teacher
New SMB password:123456
Retype new SMB password:123456
[root@zhujd ~]# systemctl stop firewalld.service
[root@zhujd ~]# setenforce 0
[root@zhujd ~]# systemctl restart smb
验证:
断开连接
3. lvm
lvm 硬盘 -> pv -> vg -> lv -> 格式化 -> 挂载 -> 使用
[root@zhujd ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sr0 11:0 1 7.9G 0 rom
nvme0n1 259:0 0 40G 0 disk
├─nvme0n1p1 259:1 0 400M 0 part /boot
└─nvme0n1p2 259:2 0 39.6G 0 part
├─rhel-root 253:0 0 26.4G 0 lvm /
└─rhel-swap 253:1 0 13.2G 0 lvm [SWAP]
nvme0n2 259:3 0 1G 0 disk
nvme0n3 259:4 0 1G 0 disk
#创建物理卷(PV)
[root@zhujd ~]# pvcreate /dev/nvme0n2 /dev/nvme0n3
Physical volume "/dev/nvme0n2" successfully created.
Physical volume "/dev/nvme0n3" successfully created.
#查看物理卷(PV)
[root@zhujd ~]# pvscan
PV /dev/nvme0n1p2 VG rhel lvm2 [<39.61 GiB / 0 free]
PV /dev/nvme0n2 lvm2 [1.00 GiB]
PV /dev/nvme0n3 lvm2 [1.00 GiB]
Total: 3 [<41.61 GiB] / in use: 1 [<39.61 GiB] / in no VG: 2 [2.00 GiB]
#创建卷组
[root@zhujd ~]# vgcreate vg1 /dev/nvme0n2 /dev/nvme0n3
Volume group "vg1" successfully created
#查看卷组
[root@zhujd ~]# vgscan
Found volume group "vg1" using metadata type lvm2
#创建逻辑卷lv1,属于vg1
[root@zhujd ~]# lvcreate -L 200M -n lv1 vg1
Logical volume "lv1" created.
#创建逻辑卷lv2,属于vg1
[root@zhujd ~]# lvcreate -l 100 -n lv2 vg1
Logical volume "lv2" created.
#查看逻辑卷
[root@zhujd ~]# lvscan
ACTIVE '/dev/vg1/lv1' [200.00 MiB] inherit
ACTIVE '/dev/vg1/lv2' [400.00 MiB] inherit
ACTIVE '/dev/rhel/root' [<26.37 GiB] inherit
ACTIVE '/dev/rhel/swap' [<13.24 GiB] inherit
#格式化逻辑卷,将逻辑卷lv1格式化为ext4的文件系统。
[root@zhujd ~]# mkfs.ext4 /dev/vg1/lv1
mke2fs 1.45.4 (23-Sep-2019)
Creating filesystem with 204800 1k blocks and 51200 inodes
Filesystem UUID: c41bcbe2-8fae-43c7-bb9e-af51ef69897e
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729
Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
#减少
[root@zhujd ~]# lvresize -l -25 /dev/vg1/lv1
#扩容
[root@zhujd ~]# lvresize -L +100M /dev/vg1/lv1