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

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

crifan.com crifan 2338浏览 0评论

现在访问book的二级域名,还是有问题的:

http://book.crifan.com

因为nginx配置没上传上去。

先去更新配置,再传上去。

然后发现还有文件没有备份呢

<code>[root@crifan ~]# cd /home/wwwroot/
[root@crifan wwwroot]# ll
total 8907912
drwxr-xr-x  5 www  www        4096 Dec  6  2017 book.crifan.com
drwxr-xr-x  3 www  www        4096 Sep 10  2017 crifan
drwx--S--- 12 www  ftp        4096 Mar 20  2018 p7zip_16.02
-rw-r--r--  1 root root    4239909 Jul 14  2016 p7zip_16.02_src_all.tar.bz2
drwxr-xr-x 13 www  www        4096 Dec 22 10:29 www.crifan.com
-rw-r--r--  1 root root 9117408627 Dec 25 16:25 www.crifan.com_allFiles_20181225.7z
[root@crifan wwwroot]# du -sh book.crifan.com/
524M    book.crifan.com/
[root@crifan wwwroot]# cd book.crifan.com/
[root@crifan book.crifan.com]# ll -lha
total 28K
drwxr-xr-x  5 www  www  4.0K Dec  6  2017 .
drwxr-xr-x  6 root root 4.0K Dec 25 15:29 ..
drwxr-xr-x 19 root root 4.0K Sep 20 18:48 books
drwxr-xr-x  2 root root 4.0K Dec  6  2017 common
-rw-r--r--  1 root root  181 Dec  6  2017 index.html
-rw-r--r--  1 root root   56 Dec  6  2017 .user.ini
drwxr-xr-x  2 root root 4.0K Dec 15 03:04 .well-known
[root@crifan book.crifan.com]# cd ..
[root@crifan wwwroot]# ll
total 8907912
drwxr-xr-x  5 www  www        4096 Dec  6  2017 book.crifan.com
drwxr-xr-x  3 www  www        4096 Sep 10  2017 crifan
drwx--S--- 12 www  ftp        4096 Mar 20  2018 p7zip_16.02
-rw-r--r--  1 root root    4239909 Jul 14  2016 p7zip_16.02_src_all.tar.bz2
drwxr-xr-x 13 www  www        4096 Dec 22 10:29 www.crifan.com
-rw-r--r--  1 root root 9117408627 Dec 25 16:25 www.crifan.com_allFiles_20181225.7z
[root@crifan wwwroot]# 
</code>

所以要去压缩和下载

<code>[root@crifan wwwroot]# 7za a -t7z -r -bt book.crifan.com_allFiles_20181230.7z book.crifan.com/*

7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,64 bits,2 CPUs x64)

Scanning the drive:
574 folders, 1725 files, 542758055 bytes (518 MiB)

Creating archive: book.crifan.com_allFiles_20181230.7z

Items to compress: 2299

Files read from disk: 1725
Archive size: 504449464 bytes (482 MiB)
Everything is Ok
[root@crifan wwwroot]# ls -lh
total 9.0G
drwxr-xr-x  5 www  www  4.0K Dec  6  2017 book.crifan.com
-rw-r--r--  1 root root 482M Dec 30 15:50 book.crifan.com_allFiles_20181230.7z 
</code>

然后去下载时,速度很慢,只有10多KB,现在去加上ss的代理

再去设置速度快的jp的节点:

现在下载速度暴快,达到1M多:

感觉后续想要book.crifan.com能正常显示的话,nginx可以自己参考之前Linode的book.crifan.com配置,是不是也可以通过vhost.sh去添加

好像是的,要不也去试试

去试试用vhost添加book.crifan.com

<code>[root@VM_0_11_centos book.crifan.com]# cd /root/
[root@VM_0_11_centos ~]# ll
total 265496
drwxr-xr-x 7 root root      4096 Dec 25 21:00 oneinstack
-rw-r--r-- 1 root root 271859821 Dec 25 19:55 oneinstack-full.tar.gz
lrwxrwxrwx 1 root root        28 Dec 26 20:54 www.crifan.com -&gt; /data/wwwroot/www.crifan.com
[root@VM_0_11_centos ~]# c oneinstack^C
[root@VM_0_11_centos ~]# cd oneinstack/
[root@VM_0_11_centos oneinstack]# ./vhost.sh

#######################################################################
#       OneinStack for CentOS/RedHat 6+ Debian 7+ and Ubuntu 12+      #
#       For more information please visit https://oneinstack.com      #
#######################################################################

What Are You Doing?
        1. Use HTTP Only
        2. Use your own SSL Certificate and Key
        3. Use Let's Encrypt to Create SSL Certificate and Key
        q. Exit
Please input the correct option: 3

Please input domain(example: www.example.com): book.crifan.com
domain=book.crifan.com

Please input the directory for the domain:book.crifan.com :
(Default directory: /data/wwwroot/book.crifan.com): 
Virtual Host Directory=/data/wwwroot/book.crifan.com

Create Virtul Host directory......
set permissions of Virtual Host directory......

Do you want to add more domain name? [y/n]: n

Do you want to redirect all HTTP requests to HTTPS? [y/n]: y
[Sun Dec 30 16:42:51 CST 2018] Creating domain key
[Sun Dec 30 16:42:51 CST 2018] The domain key is here: /root/.acme.sh/book.crifan.com/book.crifan.com.key
[Sun Dec 30 16:42:51 CST 2018] Single domain='book.crifan.com'
[Sun Dec 30 16:42:51 CST 2018] Getting domain auth token for each domain
[Sun Dec 30 16:42:51 CST 2018] Getting webroot for domain='book.crifan.com'
[Sun Dec 30 16:42:51 CST 2018] Getting new-authz for domain='book.crifan.com'
[Sun Dec 30 16:42:53 CST 2018] The new-authz request is ok.
[Sun Dec 30 16:42:53 CST 2018] Verifying:book.crifan.com
[Sun Dec 30 16:42:57 CST 2018] Success
[Sun Dec 30 16:42:57 CST 2018] Verify finished, start to sign.
[Sun Dec 30 16:43:00 CST 2018] Cert success.
-----BEGIN CERTIFICATE-----
MIIFVzC。。。
JwUDKu6Z4iLfXZYj4y2tMN3ByKUg95w4U63W
-----END CERTIFICATE-----
[Sun Dec 30 16:43:00 CST 2018] Your cert is in  /root/.acme.sh/book.crifan.com/book.crifan.com.cer 
[Sun Dec 30 16:43:00 CST 2018] Your cert key is in  /root/.acme.sh/book.crifan.com/book.crifan.com.key 
[Sun Dec 30 16:43:01 CST 2018] The intermediate CA cert is in  /root/.acme.sh/book.crifan.com/ca.cer 
[Sun Dec 30 16:43:01 CST 2018] And the full chain certs is there:  /root/.acme.sh/book.crifan.com/fullchain.cer 

Do you want to add hotlink protection? [y/n]: n

Allow Rewrite rule? [y/n]: n

Allow Nginx/Tengine/OpenResty access_log? [y/n]: y
You access log file=/data/wwwlogs/book.crifan.com_nginx.log

nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
Reload Nginx......

#######################################################################
#       OneinStack for CentOS/RedHat 6+ Debian 7+ and Ubuntu 12+      #
#       For more information please visit https://oneinstack.com      #
#######################################################################
Your domain:                  book.crifan.com
Virtualhost conf:             /usr/local/nginx/conf/vhost/book.crifan.com.conf
Directory of:                 /data/wwwroot/book.crifan.com
Let's Encrypt SSL Certificate:/usr/local/nginx/conf/ssl/book.crifan.com.crt
SSL Private Key:              /usr/local/nginx/conf/ssl/book.crifan.com.key
[root@VM_0_11_centos oneinstack]# 
</code>

然后nginx重新加载配置:

<code>[root@VM_0_11_centos vhost]# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[root@VM_0_11_centos vhost]# service nginx reload
Redirecting to /bin/systemctl reload nginx.service
</code>

然后就可以了:

https://book.crifan.com

https://book.crifan.com/books/

不能直接访问:

要直接打开对应book的地址:

https://book.crifan.com/books/api_tool_postman/website/

【总结】

准备文件:

先去旧服务器Linode中,备份book.crifan.com的文件

<code>7za a -t7z -r -bt book.crifan.com_allFiles_20181230.7z book.crifan.com/*
</code>

然后通过FileZilla通过SFTP(基于SSH的,用SSH的用户名和密码)去下载下来

注意:可以通过使用ss的SOCK5的代理去加速,ss用速度很快的jp节点

下载下来后,去上传到新服务器,再去解压

<code>7za x book.crifan.com_allFiles_20181230.7z
</code>

准备域名:

按道理可以自己去添加nginx中的配置的。

不过可以借助OneinStack的vhost去添加:

<code>./vhost.sh
</code>

核心参数:

  • 域名:book.crifan.com

  • 根路径:/data/wwwroot/book.crifan.com

转载请注明:在路上 » 【已解决】WordPress网站crifan.com搬家腾讯云后解决二级域名book.crifan.com的页面访问

发表我的评论
取消评论

表情

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

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

网友最新评论 (1)

    85 queries in 0.194 seconds, using 22.17MB memory