系统服务综合作业

首先配置自动挂载 服务器的/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

相关推荐
爱吃山竹的大肚肚1 小时前
EasyPOI 大数据导出
java·linux·windows
极地星光1 小时前
dmesg 工具的核心功能与作用
linux
雾削木1 小时前
k230 Pyhton三角形识别
运维·服务器·网络·stm32·智能路由器
北京聚信万通科技有限公司2 小时前
传输协议:AS3
服务器·网络·安全·电子数据交换·as3
福尔摩斯张2 小时前
C++核心特性精讲:从C语言痛点出发,掌握现代C++编程精髓(超详细)
java·linux·c语言·数据结构·c++·驱动开发·算法
hgz07102 小时前
Linux服务器环境部署与JMeter压测准备
linux·服务器·jmeter
ShirleyWang0123 小时前
VMware如何导入vmdk文件
linux·数据库
大连好光景3 小时前
Python打日志
运维·python·运维开发
Lueeee.3 小时前
内核menuconfig配置实验
linux
遇见火星3 小时前
常见Systemctl语句
linux·服务器·网络·systemctl