系统服务综合作业

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

相关推荐
Christal_pyy41 分钟前
树莓派4基于Debian GNU/Linux 12 (Bookworm)添加多个静态ipv4网络
linux·网络·debian
csbDD2 小时前
2025年网络安全(黑客技术)三个月自学手册
linux·网络·python·安全·web安全
李狗蛋儿啊2 小时前
zero自动化框架搭建---Git安装详解
运维·git·自动化
小金的学习笔记2 小时前
如何在本地和服务器新建mysql用户和密码
运维·服务器·mysql
s_fox_3 小时前
nginx ngx_http_module(7) 指令详解
运维·nginx·http
EasyNVR3 小时前
EasyRTC智能硬件:实时畅联、沉浸互动、消音护航
运维·服务器·网络·安全·音视频·webrtc·p2p
CarryBest3 小时前
Jenkins 环境搭建---基于 Docker
运维·jenkins
若云止水4 小时前
Ubuntu 下 nginx-1.24.0 源码分析 - ngx_process_options
运维·nginx
s_fox_4 小时前
nginx ngx_http_module(9) 指令详解
运维·nginx·http
风口上的猪20154 小时前
thingboard告警信息格式美化
java·服务器·前端