系统服务综合作业

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

相关推荐
---学无止境---12 分钟前
Linux中系统调用sys_symlink和sys_unlink函数的实现
linux
代码程序猿RIP21 分钟前
【Etcd 】Etcd 详解以及安装教程
linux·数据库·etcd
tb_first1 小时前
Linux入门1(2/2)
linux
cellurw1 小时前
Day72 传感器分类、关键参数、工作原理与Linux驱动开发(GPIO/I²C/Platform/Misc框架)
linux·c语言·驱动开发
NextZeros2 小时前
基于CentOS安装LNMP
linux·centos
梁萌2 小时前
Linux安装mysql8.4.6
linux·运维·mysql安装·8.4.6
gtr20202 小时前
Ubuntu24.04 无法读取 U盘
linux
南棱笑笑生2 小时前
20251028在Ubuntu20.04.6上编译AIO-3576Q38开发板的Buildroot系统
大数据·linux·服务器·rockchip
FreeBuf_2 小时前
Ubuntu内核曝严重UAF漏洞,可致攻击者获取Root权限
linux·运维·ubuntu
Jason_zhao_MR2 小时前
RK3576机器人核心:三屏异显+八路摄像头,重塑机器人交互与感知
linux·人工智能·嵌入式硬件·计算机视觉·机器人·嵌入式·交互