最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【记录】crifan.com的WordPress网站从Linode搬家到腾讯云香港服务器

crifan.com crifan 2587浏览 0评论

背景:

之前一直用Linode服务器,用了几年了,虽然稳定性不错,功能也不错,但是:

国内访问Linode的各个节点的速度:实在太不稳定了

speed test时

Facilities Speed Test – Linode

速度经常不错,但是实际上访问自己的网站,经常无法打开(必须翻墙才行)

所以纠结了很长时间,要不要换,换成最好是国内的服务器,考虑阿里云或腾讯云的。

但是国内服务器又要备案,所以考虑香港节点,不过价格很贵

2C4G,1M,最低也要2900+元/年,2M,3M的要3000+元/年

纠结了很长时间后,最后通过:

【调研】腾讯云或阿里云的香港或新加坡的服务器访问速度和性价比如何

找到海外云专场,里面有优惠的香港节点,所以打算去购买:

【记录】去腾讯云的海外云专场去购买香港节点的VPS服务器

然后去:

【记录】登录和配置腾讯云CVM云主机服务器

这样新服务器就是买好了。

接着再去备份原网站数据

  • 文件

  • mysql数据库

参考之前自己的:

【记录】备份crifan.com的WordPress网站

重新操作一遍即可。

然后再去把7z下载到mac本地,然后去解压:

【已解决】Mac中如何解压7z文件

在WordPress网站全部文件下载下来之前,可以接着去搭建web环境:

【已解决】腾讯云香港服务器CentOS中用OneinStack搭建Web环境

在此期间,去ping了服务器看看速度如何:

<code>➜  ~ ping 150.109.113.228
PING 150.109.113.228 (150.109.113.228): 56 data bytes
64 bytes from 150.109.113.228: icmp_seq=0 ttl=48 time=148.051 ms
Request timeout for icmp_seq 1
64 bytes from 150.109.113.228: icmp_seq=2 ttl=48 time=149.773 ms
64 bytes from 150.109.113.228: icmp_seq=3 ttl=48 time=147.007 ms
64 bytes from 150.109.113.228: icmp_seq=4 ttl=48 time=148.455 ms
64 bytes from 150.109.113.228: icmp_seq=5 ttl=48 time=148.690 ms
64 bytes from 150.109.113.228: icmp_seq=6 ttl=48 time=153.425 ms
64 bytes from 150.109.113.228: icmp_seq=7 ttl=48 time=148.500 ms
64 bytes from 150.109.113.228: icmp_seq=8 ttl=48 time=149.689 ms
64 bytes from 150.109.113.228: icmp_seq=9 ttl=48 time=147.185 ms
^C
--- 150.109.113.228 ping statistics ---
10 packets transmitted, 9 packets received, 10.0% packet loss
round-trip min/avg/max/stddev = 147.007/148.975/153.425/1.809 ms
➜  ~
➜  ~
➜  ~ ping 150.109.113.228
PING 150.109.113.228 (150.109.113.228): 56 data bytes
64 bytes from 150.109.113.228: icmp_seq=0 ttl=48 time=146.373 ms
64 bytes from 150.109.113.228: icmp_seq=1 ttl=48 time=144.149 ms
64 bytes from 150.109.113.228: icmp_seq=2 ttl=48 time=146.691 ms
64 bytes from 150.109.113.228: icmp_seq=3 ttl=48 time=146.775 ms
64 bytes from 150.109.113.228: icmp_seq=4 ttl=48 time=144.196 ms
^C
--- 150.109.113.228 ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 144.149/145.637/146.775/1.203 ms
</code>

好像很一般啊:

ping值基本都在150ms

又测了下,恢复稳定到50ms前后了:

<code>➜  ~ ping 150.109.113.228
PING 150.109.113.228 (150.109.113.228): 56 data bytes
64 bytes from 150.109.113.228: icmp_seq=0 ttl=48 time=149.568 ms
64 bytes from 150.109.113.228: icmp_seq=1 ttl=48 time=143.896 ms
64 bytes from 150.109.113.228: icmp_seq=2 ttl=48 time=130.411 ms
64 bytes from 150.109.113.228: icmp_seq=3 ttl=48 time=44.220 ms
64 bytes from 150.109.113.228: icmp_seq=4 ttl=48 time=42.230 ms
64 bytes from 150.109.113.228: icmp_seq=5 ttl=48 time=44.972 ms
64 bytes from 150.109.113.228: icmp_seq=6 ttl=48 time=41.817 ms
64 bytes from 150.109.113.228: icmp_seq=7 ttl=48 time=44.895 ms
64 bytes from 150.109.113.228: icmp_seq=8 ttl=48 time=44.510 ms
64 bytes from 150.109.113.228: icmp_seq=9 ttl=48 time=42.559 ms
64 bytes from 150.109.113.228: icmp_seq=10 ttl=48 time=42.435 ms
64 bytes from 150.109.113.228: icmp_seq=11 ttl=48 time=42.183 ms
64 bytes from 150.109.113.228: icmp_seq=12 ttl=48 time=55.225 ms
64 bytes from 150.109.113.228: icmp_seq=13 ttl=48 time=55.477 ms
64 bytes from 150.109.113.228: icmp_seq=14 ttl=48 time=63.174 ms
64 bytes from 150.109.113.228: icmp_seq=15 ttl=48 time=61.777 ms
64 bytes from 150.109.113.228: icmp_seq=16 ttl=48 time=42.021 ms
64 bytes from 150.109.113.228: icmp_seq=17 ttl=48 time=41.810 ms
^C
--- 150.109.113.228 ping statistics ---
18 packets transmitted, 18 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 41.810/62.954/149.568/35.817 ms
➜  ~
➜  ~ ping 150.109.113.228
PING 150.109.113.228 (150.109.113.228): 56 data bytes
64 bytes from 150.109.113.228: icmp_seq=0 ttl=48 time=61.181 ms
64 bytes from 150.109.113.228: icmp_seq=1 ttl=48 time=41.427 ms
64 bytes from 150.109.113.228: icmp_seq=2 ttl=48 time=45.065 ms
64 bytes from 150.109.113.228: icmp_seq=3 ttl=48 time=45.139 ms
^C
--- 150.109.113.228 ping statistics ---
4 packets transmitted, 4 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 41.427/48.203/61.181/7.642 ms
➜  ~
➜  ~
</code>

20181226 21:00

再去测ping速:

<code>➜  resize_image_demo ping 150.109.113.228
PING 150.109.113.228 (150.109.113.228): 56 data bytes
64 bytes from 150.109.113.228: icmp_seq=0 ttl=48 time=42.450 ms
64 bytes from 150.109.113.228: icmp_seq=1 ttl=48 time=62.226 ms
64 bytes from 150.109.113.228: icmp_seq=2 ttl=48 time=58.504 ms
64 bytes from 150.109.113.228: icmp_seq=3 ttl=48 time=44.501 ms
64 bytes from 150.109.113.228: icmp_seq=4 ttl=48 time=40.991 ms
</code>

速度还行。

然后再去上传8G多的7z到腾讯云的香港服务器上:

此处江苏苏州电信上传到腾讯云的香港服务器节点上,速度够快:2MB/s +

再去导入mysql数据:

【已解决】恢复导入从Linode备份出的crifan.com的WordPress的sql数据到腾讯云香港服务器中

在上传WordPress文件期间,先去看看dns的配置:

【已解决】去DNSPod的腾讯云中更新crifan.com的DNS域名设置

此处文件上传完毕,去解压:

【已解决】CentOS中去解压7zip格式的7z文件

再去确认文件夹的权限:

<code>[root@VM_0_11_centos wwwroot]# cd www.crifan.com/
[root@VM_0_11_centos www.crifan.com]# ll -lh
total 1.9M
-rwxr-xr-x  1 root root  613 Jun 14  2017 400.shtml
...
-rwxr-xr-x  1 root root 3.0K Jun 14  2017 xmlrpc.php
[root@VM_0_11_centos www.crifan.com]# cd ..
[root@VM_0_11_centos wwwroot]# chown -R www:www www.crifan.com
[root@VM_0_11_centos wwwroot]# cd www.crifan.com/
[root@VM_0_11_centos www.crifan.com]# ll -lh
total 1.9M
-rwxr-xr-x  1 www www  613 Jun 14  2017 400.shtml
...
-rwxr-xr-x  1 www www 3.0K Jun 14  2017 xmlrpc.php
</code>

然后再去确认之前的wp-config.php的配置

去确认此处root账号有所有的权限,包括操作当前mysql的权限:

现在已经:

  • WordPress所有文件:已上传和解压和更新了wp-config.php配置

    • 文件夹权限也赋值给www用户和组了

  • mysql:已上传和导入到此处的crifan_wp_db

    • 也确保root用户和密码是对的

剩下好像只需要去更新DNS域名

然后再去继续:

【已解决】给腾讯云香港CVM的CentOS中OneinStack中添加虚拟主机vhost配置

添加vhost,应该就可以了。后来去弄了:

【已解决】去DNSPod的腾讯云中更新crifan.com的DNS域名设置

真的也就可以了。

然后再去确认WordPress中的wp-config.php的配置正确,

这样应该去访问域名,就可以访问到主页了

https://www.crifan.com

结果报错:

建立数据库连接时出错

去确认一下

至少IP是最新服务器中的了

重新更新了wp-config.php,上传上去,设置权限:

<code>[root@VM_0_11_centos www.crifan.com]# rz
rz waiting to receive.
Starting zmodem transfer.  Press Ctrl+C to cancel.
Transferring wp-config.php...
  100%       3 KB       3 KB/sec    00:00:01       0 Errors  

[root@VM_0_11_centos www.crifan.com]# ll
total 1940
-rwxr-xr-x  1 www  www     613 Jun 14  2017 400.shtml
...
-rw-r--r--  1 root root   3656 Dec 26 23:03 wp-config.php
-rwxr-xr-x  1 www  www    2735 Dec 16 19:37 wp-config-sample.php
...
[root@VM_0_11_centos www.crifan.com]# chown www:www wp-config.php 
[root@VM_0_11_centos www.crifan.com]# ll
total 1940
-rwxr-xr-x  1 www www    613 Jun 14  2017 400.shtml
。。。
-rw-r--r--  1 www www   3656 Dec 26 23:03 wp-config.php
-rwxr-xr-x  1 www www   2735 Dec 16 19:37 wp-config-sample.php
...
-rwxr-xr-x  1 www www   3065 Jun 14  2017 xmlrpc.php
</code>

然后再去访问

https://www.crifan.com/

结果能看到页面,但是没有内容:

【已解决】WordPress网站搬家后页面显示但不显示内容

然后再去:

【已解决】WordPress网站crifan.com搬家腾讯云后解决二级域名book.crifan.com的页面访问

最后把 OneinStack的各种工具,都移动到default下面了,具体路径就不说了。

剩下的就是:过1,2周,等确认没问题了。再去退掉Linode的服务器:

【记录】停止注销不继续使用Linode的VPS服务器

转载请注明:在路上 » 【记录】crifan.com的WordPress网站从Linode搬家到腾讯云香港服务器

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.184 seconds, using 22.13MB memory