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-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
附):查看一下服務端給客戶端提供掛載的資料目錄
四、掛載到服務端
[root@localhost ~]# mount -t nfs 192.168.1.182:/webdate /var/www/html
附):訪問下客戶端掛載成功後的效果