NFS服务搭建

NFS服务搭建图解:
NFS服务搭建
服务端:

一、关闭防火墙
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl disable firewalld.service
[root@localhost ~]# systemctl enable firewalld.service

二、下载nfs-utils软件
[root@localhost ~]# yum install -y nfs-utils

三、设置网页存放目录,并写一个简单的网页
[root@localhost ~]# mkdir /webdate
[root@localhost ~]# echo abc123 > /webdate/index.html

四、设置哪个目录被访问(网页存放目录)?掩码、权限?
NFS服务搭建

五、启动nfs-utils软件
[root@localhost ~]# systemctl start nfs-server.service

附):查看一些本主机提供可以被访问的目录
[root@localhost ~]# exportfs -v

客户端:

一、关闭防火墙
[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# setenforce 0
[root@localhost ~]# systemctl disable firewalld.service
[root@localhost ~]# systemctl enable firewalld.service

二、下载nfs-utils和http

[root@localhost ~]# yum install -y nfs-utils httpd

三、启动httpd 和 nfs-utils
[root@localhost ~]# systemctl start httpd
[root@localhost ~]# systemctl enable httpd
[root@localhost ~]# systemctl start nfs-utils
[root@localhost ~]# systemctl enable nfs-utils

附):查看一下服务端给客户端提供挂载的资料目录
NFS服务搭建

四、挂载到服务端
[root@localhost ~]# mount -t nfs 192.168.1.182:/webdate /var/www/html

附):访问下客户端挂载成功后的效果
NFS服务搭建

猜你喜欢

转载自blog.51cto.com/kangxi/2126872