centos9使用certbot配置ssl
之前偷懒,不准备配置ssl,结果浏览器直接拦截http请求了,现在也不得不整了
我的环境:
CentOS Stream release 9
nginx version: nginx/1.22.1
安装snapd,安装后重新连ssh
sudo yum install epel-release
sudo yum install snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
sudo yum install python3-certbot-nginx
安装certbot
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
配置ssl
有两个模式:
sudo certbot --nginx:自动安装并配置nginx
sudo certbot certonly --nginx:只下载正数,然后需要手动配置nginx
我们直接用第一个就行
sudo certbot --nginx
如果有子域名的话,会提示你选择给哪一个域名配置
配置成功
centos9使用certbot配置ssl
http://xuyuanhang.com//archives/centos9shi-yong-certbotpei-zhi-ssl