运维

证书申请+自动续期

安装 Certbot,获取证书

sudo dnf install -y epel-release # 添加库
sudo dnf install -y certbot python3-certbot-nginx # 安装certbot
certbot --version # 验证
sudo certbot --nginx -d airjk.top # 获取证书

自动续期

crontab -e # 编辑自动化脚本
# 写入文件(每月 1 号执行续期)
0 0 1 * * certbot renew --quiet --renew-hook 'sudo systemctl reload nginx' > /dev/null 2>&1
# 开机启动运行 
sudo systemctl start crond
sudo systemctl enable crond
sudo systemctl status crond

回复

This is just a placeholder img.