系统服务综合作业

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

相关推荐
不做超级小白2 小时前
Termux 完整安装与配置指南(2026.4.24最新版,从零到可用)
linux·手机
Lumos_7772 小时前
Linux -- 信号
linux·运维·服务器
leikooo2 小时前
Skills 实战:Unsplash → COS 自动化配图
运维·ai·自动化
Lumos_7772 小时前
Linux -- 管道
linux·运维·服务器
哦哦~9212 小时前
揭示多功能合成界面,增强致密厚复合电极的机械和电化学性能
服务器·网络·人工智能
宇宙realman_9992 小时前
DSP28335-FlashAPI使用
linux·前端·python
华清远见IT开放实验室2 小时前
STM32+Linux双体系,零基础玩转嵌入式
linux·stm32·嵌入式硬件
重生的黑客2 小时前
Linux 进程状态详解:从理论到实践,僵尸进程与孤儿进程
linux·运维·服务器
脆皮炸鸡7553 小时前
进程的程序替换
linux·经验分享·笔记·vim·学习方法
划水的code搬运工小李3 小时前
ubuntu下使用opencode
linux·运维·ubuntu