系统服务综合作业

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

相关推荐

  1. 系统服务综合案例

    2024-07-10 22:32:01       25 阅读
  2. 分支和循环的综合作业

    2024-07-10 22:32:01       63 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-10 22:32:01       114 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-10 22:32:01       124 阅读
  3. 在Django里面运行非项目文件

    2024-07-10 22:32:01       101 阅读
  4. Python语言-面向对象

    2024-07-10 22:32:01       112 阅读

热门阅读

  1. EventBus原理分析

    2024-07-10 22:32:01       26 阅读
  2. Modelsim中使用tcl命令导出仿真数据到txt文件

    2024-07-10 22:32:01       27 阅读
  3. Spring中@Transactional的实现和原理

    2024-07-10 22:32:01       24 阅读
  4. H5小游戏开发,广告游戏开发制作

    2024-07-10 22:32:01       29 阅读
  5. 电脑多开卡顿的所有原因汇总

    2024-07-10 22:32:01       33 阅读
  6. 【C语言】通过fgets和fscanf了解读写文件流的概念

    2024-07-10 22:32:01       25 阅读