系统服务综合作业

首先配置自动挂载 服务器的/rhce  自动挂载在客服端的/nfs/rhce 

首先在服务器进行配置

dnf install nfs-utils -y
[root@localhost ~]# vim /etc/exports
[root@localhost ~]# firewall-cmd --permanent --add-service=nfs
success
[root@localhost ~]# firewall-cmd --permanent --add-service=mount
Error: INVALID_SERVICE: 'mount' not among existing services
[root@localhost ~]# firewall-cmd --permanent --add-service=mountd
success
[root@localhost ~]# firewall-cmd --permanent --add-service=rpc-bind
success
[root@localhost ~]# firewall-cmd  --reload
success
root@localhost ~]# chcon -t httpd_sys_content_t   /rhce/*
[root@localhost ~]# ll -Z /rhce/*
-rw-r--r--. 1 nobody nobody system_u:object_r:httpd_sys_content_t:s0 13 Jul  6 11:17 /rhce/index.html

在/etc/exports中

/rhce 192.168.178.143(rw)

 地址为客服端地址

客服端

dnf install nfs-utils -y

yum install autofs -y

 

重启后切换到/nfs/rhce就自动挂载了

在客服端配置web服务器

[root@localhost ~]# cd /etc/httpd/conf.d

打开自己的配置文件

 注意[root@localhost ~]# echo "this is rhce" > /nfs/rhce
-bash: /nfs/rhce: Permission denied

[root@localhost ~]# setsebool -P httpd_use_nfs 1

[root@localhost ~]# echo "this is rhce" > /nfs/rhce/index.html

 在/etc/hosts里面写本地解析

配置DNS服务器

dnf install bind bind-utils -y 

在/etc/named.conf

在/var/named/named.rhce 

 注意所有服务需要设置开机自启

systemctl enable  httpd

systemctl enable  named

systemctl enable  nfs-server

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值