项目分步7:配置网站服务(web33和web44都要操作)
安装软件(web33,web44)
[root@web33 ~]# yum -y install httpd
[root@web44 ~]# yum -y install httpd
[root@web33 ~]# yum -y install nfs-utils
[root@web44 ~]# yum -y install nfs-utils
挂载共享目录到/var/www/html
[root@web33 ~]# showmount -e
192.168.4.30 查看共享
Export list for 192.168.4.30:/sitedir *
[root@web44 ~]# showmount -e
192.168.4.30
Export list for 192.168.4.30:/sitedir *
[root@web44 ~]# vim /etc/fstab
192.168.4.30:/sitedir /var/www/html nfs defaults 0 0
[root@web33 ~]# vim /etc/fstab
192.168.4.30:/sitedir /var/www/html nfs defaults 0 0
[root@web33 ~]# mount -a
[root@web44 ~]# mount -a
启动服务
[root@web33 ~]# systemctl start
httpd
[root@web33 ~]# systemctl enable remote-fs.target //设置远程加载服务开机运行
[root@web33 ~]# systemctl enable httpd
[root@web44 ~]# systemctl start httpd
[root@web44 ~]# systemctl enable remote-fs.target
[root@web44 ~]# systemctl enable httpd
2.查看挂载信息
[root@web33 ~]# df -h
![](https://img.haomeiwen.com/i19969149/bfef8cfaf7aa2eae.png)
[root@web44 ~]# df -h
![](https://img.haomeiwen.com/i19969149/0700adf4047ceafc.png)