letsencrypt 单域名(不是泛域名)申请及自动续期

letsencrypt 单域名(不是泛域名)申请及自动续期

  • 官方参考:https://certbot.eff.org/docs/using.html#webroot
  • 不是泛域名(*.a.b),泛域名参考我之前的一篇文章:https://blog.csdn.net/phenhorlin2/article/details/85940861
  1. 申请
certbot certonly --webroot -w /var/www/example -d www.example.com -d example.com -w /var/www/other -d other.example.net -d another.other.example.net

e.g:

certbot certonly --webroot -w /opt/svr/yctracker -d tracker.ycnit.com

其中 /opt/svr/yctracker 为 web 根目录, certbot 会在这个目录下生成一个特殊的文件,然后通过域名 tracker.ycnit.com 去访问这个文件,能访问到就 验证通过。
所以需要先用nginx 设置一个80端口 vhost 根web目录指定到这个目录

  1. 更新(续期)

官方文档:https://certbot.eff.org/docs/using.html#renewing-certificates

certbot renew --deploy-hook /path/to/deploy-hook-script
  1. 强制更新

添加参数 --force-renewal

certbot renew --force-renewal --deploy-hook "/usr/bin/systemctl restart nginx"
  1. 原有的证书上添加新域名

官方文档:
https://certbot.eff.org/docs/using.html#re-creating-and-updating-existing-certificates

certbot --expand -d existing.com,example.com,newdomain.com
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值