使用Certbot配置SSL证书【ubuntu系统】
https://blog.csdn.net/weixin_45314989/article/details/124287900
https://zhuanlan.zhihu.com/p/80909555
sudo certbot renew
certbot renew --renew-hook "service nginx reload"
Step1:安装snapd【linux包管理工具】
sudo apt install snapd #安装snapd
sudo snap install core #安装core
sudo snap refresh core #刷新core
Step2::安装certbot【一个开源免费的工具,为网站自动安装基于Let’s Encrypt服务的SSL证书】
sudo snap install --classic certbot #安装certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot #创建链接以确保certbot的正确运行
Step3:创建SSL证书【使用certbot创建ssl证书】
方式一:为所有域创建 SSL 证书并在 Web 服务器中配置重定向(推荐这种)
sudo certbot --nginx #nginx安装ssl证书
sudo certbot --apache #apache安装ssl证书
方式二:为指定域创建 SSL 证书
sudo certbot --nginx -d example.com -d www.example.com
sudo certbot --apache -d example.com -d www.example.com
方式三:仅安装 SSL 证书
sudo certbot certonly --nginx
sudo certbot certonly --apache
评论区