本文共 2217 字,大约阅读时间需要 7 分钟。
需要把web01里面的wordpress程序拷贝到web02中
在web01上操作:
[root@web01 ~]# cd /application/nginx/html/ [root@web01 html]# ll total 52 -rw-r--r-- 1 root root 537 Feb 13 10:41 50x.html drwxr-xr-x 2 root root 4096 Feb 22 11:35 bbs drwxr-xr-x 7 www www 4096 Feb 24 15:07 blog -rw-r--r-- 1 root root 27435 Feb 13 14:34 gongli.jpg -rw-r--r-- 1 root root 321 Feb 13 14:40 index.html -rw-r--r-- 1 root root 612 Feb 13 10:41 index.html.ori drwxr-xr-x 2 root root 4096 Feb 22 11:22 www 打包blog [root@web01 html]# tar zcvf blog.tar.gz ./blog/ 下载到windows电脑上面。 [root@web01 html]# sz -y blog.tar.gz在web02上面操作:
[root@web02 htdocs]# pwd /application/apache/htdocs [root@web02 htdocs]# ls bbs blog index.html www 上传blog.tar.gz包到当前目录 [root@web02 htdocs]# rz -y[root@web02 htdocs]# tar xf blog.tar.gz
[root@web02 htdocs]# ls bbs blog blog.tar.gz index.html www [root@web02 htdocs]# chown -R www.www blog 浏览器打开网址: 发现可以看到图片这是因为web拷贝的blog目录中有图片导致的。
[root@web02 htdocs]# cd blog/wp-content/ [root@web02 wp-content]# ls index.php languages plugins themes upgrade uploads [root@web02 wp-content]# cd uploads/ [root@web02 uploads]# ls 2018 [root@web02 uploads]# du -sh 2018/ 320K 2018/ [root@web02 uploads]# pwd /application/apache/htdocs/blog/wp-content/uploads [root@web02 uploads]# mv 2018/ /tmp/ 再次刷新浏览器就没有图片了。设置挂载
[root@web02 uploads]# rpm -qa rpcbind nfs-utils [root@web02 uploads]# yum install -y rpcbind nfs-utils [root@web02 uploads]# rpm -qa rpcbind nfs-utils rpcbind-0.2.0-13.el6_9.1.x86_64 nfs-utils-1.2.3-75.el6_9.x86_64 [root@web02 uploads]# /etc/init.d/rpcbind start Starting rpcbind: [ OK ] [root@web02 uploads]# chkconfig rpcbind on [root@web02 uploads]# showmount -e 172.16.1.31 Export list for 172.16.1.31: /data 172.16.1.0/24 [root@web02 uploads]# mount -t nfs 172.16.1.31:/data/nfs-blog /application/apache/htdocs/blog/wp-content/uploads/ 这里的设置开机自动挂载最好是全路径: [root@web02 uploads]# which mount /bin/mount [root@web02 uploads]# echo "/bin/mount -t nfs 172.16.1.31:/data/nfs-blog /application/apache/htdocs/blog/wp-content/uploads/" >>/etc/rc.local [root@web02 uploads]# tail -3 /etc/rc.local 再次刷新网址http://blog.etiantian.org/ ,图片刷新过来了,说明ok了。如下图所示ok了。本文转自sandshell博客51CTO博客,原文链接http://blog.51cto.com/sandshell/2072873如需转载请自行联系原作者
sandshell