阅读量:1
在Ubuntu LNMP中设置SSL证书,通常使用Let’s Encrypt免费证书,步骤如下:
- 安装Certbot:
sudo apt update sudo apt install certbot python3-certbot-nginx - 获取证书:
(按提示操作,自动配置Nginx)sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com - 验证配置:
sudo nginx -t # 检查配置语法 sudo systemctl reload nginx # 重载Nginx - 启用自动续期:
Certbot会自动创建定时任务,可手动测试续订:sudo certbot renew --dry-run - 配置防火墙:
sudo ufw allow 'Nginx Full' - 验证证书:
浏览器访问https://yourdomain.com,查看安全锁图标确认生效。
若需使用其他证书(如ZeroSSL),需先生成证书文件,再手动配置Nginx路径。
以上就是关于“Ubuntu LNMP中如何设置SSL证书”的相关介绍,筋斗云是国内较早的云主机应用的服务商,拥有10余年行业经验,提供丰富的云服务器、租用服务器等相关产品服务。云服务器资源弹性伸缩,主机vCPU、内存性能强悍、超高I/O速度、故障秒级恢复;电子化备案,提交快速,专业团队7×24小时服务支持!
简单好用、高性价比云服务器租用链接:https://www.jindouyun.cn/product/cvm