Linux之动静分离

创建NFS挂载点

mkdir /static
vim /etc/exports
/static      172.16.1.0/20(rw,sync,all_squash,anonuid=666,anongid=666)
systemctl restart nfs-server
chown -R www.www /static/

将静态资源放置于挂载点内

mkdir /opt/static/s
[root@web01 static]# cp -r /opt/bbs/static/* /opt/static/s/

挂载到lb01

yum install nfs-utils -y
mount -t nfs 172.16.1.31:/static /opt/static/

测试

 

posted @ 2022-01-09 15:24  那就凑个整吧  阅读(34)  评论(0编辑  收藏  举报