系统服务综合作业

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

相关推荐
pride.li18 分钟前
海思视觉Hi3516CV610--开机自动设置ip
linux·网络·网络协议·tcp/ip
我叫张小白。24 分钟前
CentOS 7 安装 Docker并配置镜像加速(完整指南)
linux·docker·centos
OpsEye31 分钟前
系统负载高一定是CPU问题吗?
运维·cpu·it
源图客1 小时前
Minio配置HTTPS服务
服务器·网络协议·https
修炼室1 小时前
外网环境原生直连校内服务器:基于内网穿透 + SSH 密钥认证的完整实践指南
服务器·ssh·php
Titan20241 小时前
Linux动静态库
linux·服务器·c++
AOwhisky2 小时前
MySQL 学习笔记(第六期):MySQL 备份与恢复
运维·数据库·笔记·学习·mysql·云计算
赵民勇2 小时前
Linux file命令详解
linux·运维
li-xun2 小时前
LINUX DO 社区注册机制调整与公益 AI 服务动态
linux·运维·人工智能
j_xxx404_2 小时前
MySQL表操作硬核解析:从 CREATE TABLE 到磁盘文件、ALTER TABLE 与 DDL 风险
运维·服务器·数据库·c++·mysql·adb·ai