我是靠谱客的博主 冷酷高山,这篇文章主要介绍letsencrypt 单域名(不是泛域名)申请及自动续期,现在分享给大家,希望可以做个参考。

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

  • 官方参考:https://certbot.eff.org/docs/using.html#webroot
  • 不是泛域名(*.a.b),泛域名参考我之前的一篇文章:https://blog.csdn.net/phenhorlin2/article/details/85940861
  1. 申请
复制代码
1
2
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:

复制代码
1
2
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

复制代码
1
2
certbot renew --deploy-hook /path/to/deploy-hook-script
  1. 强制更新

添加参数 --force-renewal

复制代码
1
2
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

复制代码
1
2
certbot --expand -d existing.com,example.com,newdomain.com

最后

以上就是冷酷高山最近收集整理的关于letsencrypt 单域名(不是泛域名)申请及自动续期的全部内容,更多相关letsencrypt内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(71)

评论列表共有 0 条评论

立即
投稿
返回
顶部