1. 安装epel-release
1 | sudo yum install epel-release |
2. 安装snapd,并设置
1 | sudo yum install snapd |
3. 如果有安装cenrbot的,先移除
1 | sudo yum remove certbot |
4. 安装certbot
1 | sudo snap install --classic certbot |
5. 建立certbot软连接,方便命令行调用
1 | sudo ln -s /snap/bin/certbot /usr/bin/certbot |
6. 安装证书
1 | sudo certbot --nginx |
会要求输入邮箱,另外两次询问,都回复Y,最后选择要安装的域名即可
7. 测试更新证书是否生效
1 | sudo certbot certonly --nginx |
完成后会自动写入定时任务,通过 systemctl list-timers 可以查看到