配置nfs服务器,通过nfs服务器共享网站首页文件;
配置http服务器 过ip方式访问nfs服务器共享的网站首页文件内容,显示为welcome to openlab.
Server
#yum install nfs-utils rpcbind -y
#vim /etc/exports
/openlab *(rw,all_squash,anonuid=2333,anongid=2333)
#echo welcome to openlab > /openlab/index.html
#chmod 777 /openlab/index.html
Client
#yum install nfs-utils rpcbind httpd -y
#mkdir /openlabclient/
#mount 192.168.155.28:/openlab /openlabclient/
#vim /etc/httpd/conf.d/openlab.conf
#vim /etc/httpd/conf.d/openlab.conf
<virtualhost 192.168.155.30>
servername 192.168.168.30
documentroot /openlabclient
</virtualhost>
<directory /openlabclient>
allowoverride none
require all granted
</directory>
~
#systemctl restart httpd
#setenforce 0
#curl 192.168.155.30