工具安装

$ sudo apt-get update

$ sudo apt-get install software-properties-common

$ sudo add-apt-repository ppa:certbot/certbot

$ sudo apt-get update

$ sudo apt-get install python-certbot-nginx

采用nginx作为服务器

$ sudo certbot --nginx

续约

$ sudo certbot renew --dry-run

由于该免费证书的默认有效期为一个月,为了防止我们忘记证书到期时间,可以使用Linux的crontab工具来定时检查更新。

ps:时间定义根据自己配置生效时间

$ sudo crontab -e

.
.
# m     h    dom     mon   dow   command
59 23  * * * sudo certbot renew --dry-run

注:您的域名必须为经过DNS解析的域名

本例使用Nginx进行演示 Nginx on Ubuntu 16.04 (xenial)

参考链接:https://certbot.eff.org

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐