分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 代码编程

LAMP-----3、wordpress网站从web01复制到web02中

发布时间:2023-09-06 01:43责任编辑:彭小芳关键词:word
需要把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
浏览器打开网址:http://blog.etiantian.org/ 发现可以看到图片

这是因为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了。

LAMP-----3、wordpress网站从web01复制到web02中

原文地址:http://blog.51cto.com/sandshell/2072873

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved