我原本使用 dehydrated,前阵子开始改用 certbot。
对我这懒人来说,certbot 有 rpm & dpkg,也都有 yum 跟 apt 的 repositories 可用,这点挺重要啊~
单机(纯 hostname)的 certificate 搭配 nginx 用这行指令就可以完成:
certbot certonly --nginx -d {hostname}
取用 wildcard certificate 的话可以先看看 certbot 的 DNS Plugins 文件。
我自己的网域 DNS server 是自己掌管的,搭配的是 certbot-dns-rfc2136 。
编辑完设定档(eg. /etc/letsencrypt/rfc2136.ini)之后后也是一行指令完成:
certbot certonly \ --dns-rfc2136 \ --dns-rfc2136-credentials /etc/letsencrypt/rfc2136.ini \ -d *.{DOMAIN} -d {DOMAIN}
另外,在 Ubuntu 安装的 certbot 已经使用 systemd 的 timers 触发定时更新,用下面这行指令可以确认其状况。
systemctl status certbot.timer