1.下载安装epel包
yum install epel-release
2.下载安装snap
yum install snapd
systemctl enable --now snapd.socket
创建软连接
ln -s /var/lib/snapd/snap /snap
下载核心包
sudo snap install core
3.下载安装certbot
sudo snap install --classic certbot
4.生成证书
sudo certbot certonly -w /home/public_html/ -d xxxxx(domain)
5.将证书copy到指定文件夹下
sudo cp /etc/letsencrypt/live/xxxxx(domain)/privkey.pem /home/ssl.key
sudo cp /etc/letsencrypt/live/xxxxx(domain)/cert.pem /home/ssl.cert
6.配置nginx以及重启nginx服务。