系统服务综合作业

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

相关推荐
fjh19971 分钟前
使用caddy签发ip证书
运维·服务器
Roc.Chang27 分钟前
Vite 启动报错:listen EACCES: permission denied 0.0.0.0:80 解决方案
linux·前端·vue·vite
暴力求解39 分钟前
Linux进程(六)命令行参数
linux·运维·服务器
我怎么又饿了呀1 小时前
Linux 下 的Vim/Vi 操作指南
linux·运维·vim
野犬寒鸦1 小时前
深入解析HashMap核心机制(底层数据结构及扩容机制详解剖析)
java·服务器·开发语言·数据库·后端·面试
专注前端30年3 小时前
负载均衡实战项目搭建指南:从基础到高可用全流程
运维·数据库·负载均衡
码云数智-大飞3 小时前
负载均衡:让网站“扛得住”千万用户访问的秘密武器
运维·负载均衡
AI云原生与云计算技术学院3 小时前
提示系统负载均衡设计:架构师如何通过负载策略提升提示服务的稳定性
运维·ai·负载均衡
nudt_qxx4 小时前
CUDA编程模型与硬件执行层级对应关系
linux·人工智能·算法
猫头虎4 小时前
web开发常见问题解决方案大全:502/503 Bad Gateway/Connection reset/504 timed out/400 Bad Request/401 Unauthorized
运维·前端·nginx·http·https·gateway·openresty