今天给 halo 博客配置 https,按照 halo 官方文档使用 certbot 来配置 SSL 证书
一、安装
1.CentOS
# 安装 certbot 以及 certbot nginx 插件
sudo yum install certbot python2-certbot-nginx -y
2.Debian
sudo apt update
sudo apt install python3-acme python3-certbot python3-mock python3-openssl python3-pkg-resources python3-pyparsing python3-zope.interface
sudo apt install python3-certbot-nginx
3.碰到的问题
(1)urllib3 安装失败
结果我执行完第一步就提示我——安装 python2-urllib3 失败,我想手动装一下urllib3 算了。
安装完 urllib3,继续执行第二步。
结果又提示我 urllib3 版本过低,啊这。
那就按照他要求来吧
pip install --upgrade --force-reinstall 'requests==2.6.0' urllib3
继续按照文档走,终于完成了配置。
二、申请证书和自动续约
# 执行配置,中途会询问你的邮箱,如实填写即可
sudo certbot --nginx
# 自动续约
sudo certbot renew --dry-run
如果证书没了,重复上面的 2-3 步,就OK了!
三、删除证书
certbot delete
按提示删除即可
评论区