Forward analysis, NFS practical experiment analysis~

Experimental simulation notes

(1) Requirements

– Prepare 3 virtual machines, a Windows virtual machine PC1 (win7 or win10 is not limited), a Linux server server1 (IP is 172.16.100.100/24) and an empty virtual machine server2. The virtual machine network uses host-only mode.

(2) Topic One

-Server1 provides DHCP service to assign IP addresses of corresponding network segments to PC1 and server2.
--Server1 provides PXE service, which enables server2 to automatically install Centos7 Linux operating system.
– Install and start the httpd service on server1 to provide external Web services, and build a DNS service to resolve the address www.kgc.com, so that PC1 can use the domain name www.kgc.com to access the Web server.

yum install -y bind            //安装
rpm -qc bind                   //查看是否安装
vim /etc/named.conf            //进入配置文件

Insert picture description here

vim /etc/named.rfc1912.zone      //进入配置文件

Insert picture description here

cd /var/named/           //进入named目录
cp -p named.localhost kgc.com.zone 
                         //复制文件named.localhost并改名
vim /var/named/kgc.com.zone
                         //进入刚刚复制的配置文件

Insert picture description here

vim /etc/resolv.conf            //进入配置文件

Insert picture description here

systemctl stop firewalld        //关闭防火墙
setenforce 0

Insert picture description here

(3) Topic 2

Install the NFS service on server2, provide the shared directory /share, create the file index.html in the /share directory, and customize the file content. Mount the /share directory of server2 to the /var/www/html directory of server1 through NFS, so that PC1 can display customized content when accessing the Web service.

yum -y install nfs-utils rpcbind          //安装文件
systemctl stop firewalld                  //关闭防火墙
setenforce 0
mkdir /share                              //创建share目录
chmod 777 /share                          //修改文件权限
vim /etc/exports                          //进入配置文件

Insert picture description here

systemctl start rpcbind ;             //重启服务
systemctl start nfs
Cd /share                             //进入share目录
Touch index.html                      //创建空文件
vim /share/index.html                 //进入文件进行编写
随便输入文本
Yum install -y httpd                  //安装服务
Operation on the client:
yum -y install nfs-utils rpcbind                 //安装包
systemctl start rpcbind                          //重启服务
systemctl enable rpcbind
mount 172.16.100.100:/share /var/www/html        //挂载
在windows浏览器输入www.kgc.com查看页面上有之前乱输入的文本

Guess you like

Origin blog.csdn.net/weixin_51468875/article/details/111203179