博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
LAMP-----3、wordpress网站从web01复制到web02中
阅读量:6972 次
发布时间:2019-06-27

本文共 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
浏览器打开网址: 发现可以看到图片
LAMP-----3、wordpress网站从web01复制到web02中

这是因为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/
再次刷新浏览器就没有图片了。
LAMP-----3、wordpress网站从web01复制到web02中

设置挂载

[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了。
LAMP-----3、wordpress网站从web01复制到web02中

本文转自sandshell博客51CTO博客,原文链接http://blog.51cto.com/sandshell/2072873如需转载请自行联系原作者

sandshell

你可能感兴趣的文章
ajax跨域请求的问题
查看>>
mybatis批量保存的两种方式(高效插入)
查看>>
LA 3644 易爆物
查看>>
登录时记住用户名和密码及cookie案例应用
查看>>
对于一个小白来说,遇到的前端问题(2)
查看>>
cocos2dx-新建工程时避免文件和文件夹的拷贝
查看>>
[bzoj 3622]已经没有什么好害怕的了
查看>>
【文文殿下】CF1175F The Number of Subpermutations
查看>>
Struts2配置文件_常量属性_独立测试分析
查看>>
c语言代写
查看>>
技巧:Vim 的纵向编辑模式【转】
查看>>
[转载]linux内存映射mmap原理分析【转】
查看>>
Linux之定时器与时间管理 【转】
查看>>
Linux的软中断处理实现 【转】
查看>>
深入理解Java中的反射机制
查看>>
C# 面向对象
查看>>
并发异步处理队列 .NET 4.5+
查看>>
Udp SocketAsyncEventArgs SocketAsyncDataHandler
查看>>
JVM入门
查看>>
selenium web自动化
查看>>