今天我来记录一下我迁移https证书的方法,因为在迁移服务器的时候,再次renew的时候会出错。
以下是错误截图

Error: Your account credentials have been saved in your Certbot
configuration directory at /etc/letsencrypt. You should make a
secure backup of this folder now. This configuration directory will
also contain certificates and private keys obtained by Certbot so
making regular backups of this folder is ideal.
既然出错了我们就来解决。
解决方案:
1.进入到服务器cd ./etc,然后将原有的证书全复制到etc目录下(letsencrypt这整个目录)。
2.进入到letsencrypt目录下(cd letsencrypt),给live, renewal, archive授权(chmod -0755)
3.cd live/***.com(cn,net)/,rm ./*.*.全部删掉。
4.ln -s ../../archive/xxx.com/cert1.pem, ln -s ../../archive/xxx.com/chain1.pem,
ln -s ../../archive/xxx.com/fullchain1.pem, ln -s ../../archive/xxx.com/privkey1.pem
5.改名字,把后缀1全部去掉。
6.cd /etc/letsencrypt,更新一下certbot update_symlinks
7.最后就可以certbot renew.
看就是这么简单。
网友评论