Certbot使用记录

免费使用SSL,还得手动维护域名有效时间,能否实现一键部署SSL,并自动脚本化续费,这个需求一点不过分,然后GitHub上找到了一个机器人🤖。

选择系统版本
选择系统版本

接下来跳过各种说,直接执行命令即可(针对centos8)

# snap 安装
sudo yum install snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap

# certbot 安装
sudo snap install --classic certbot # 前3步必须使用
sudo ln -s /snap/bin/certbot /usr/bin/certbot

# 校验安装情况
[root@chain123 iamxmm.xyz]# certbot --version
certbot 1.23.0

# 主要命令
certbot --nginx # 插件名
				--nginx-server-root=/data1/app/services/nginx/conf/ # Nginx配置目录
				--nginx-ctl=/data1/app/services/nginx/sbin/nginx # Nginx可执行文件路径

# 完整
[root@chain123 sbin]# certbot --nginx --nginx-server-root=/data1/app/services/nginx/conf/ --nginx-ctl=/data1/app/services/nginx/sbin/nginx

走到这一步已经完成一大半了,下面只需要按照你的实际情况,指定好域名就可以配置了。

步骤-1
步骤-1
完成步骤
完成步骤

超级简单,比上一篇手动申请配置,部署简单很多。

Subscribe to Iamxmm
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.