1、Let's Encrypt
她推荐使用 Certbot 客户端请求证书,直接访问 Certbot 站点开干 : Certbot
2、Certbot 站点首页上直接选择操作系统和服务器软件,页面直接给出操作步骤
非常简单,按照操作步骤执行即可,本文不再赘述,重点说明下过程中遇到的问题。
问题1:
错误信息:
The nginx plugin is not working; there may be problems with your existing configuration. The error was: NoInstallationError("Could not find a usable 'nginx' binary. Ensure nginx exists, the binary is executable, and your PATH is set correctly.",)
解决方案:
为Nginx建立软连接
ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx
ln -s /usr/local/nginx/conf/ /etc/nginx
问题2:
如果是自动安装配置,必须要为网站开通80端口。
如果不是自动安装配置,只是获取证书,那就无所谓了。
- Nginx 监听 80 端口
- 云服务器(阿里,腾讯等)必须放开 TPC 80 端口 和 UDP 80 端口
- 防火墙允许TCP 、 UDP协议及80端口访问
问题3:
自动续订失败,错误信息:
Fetching http://你的域名/.well-known/acme-challenge/xxxxxxx: Timeout during connect (likely firewall problem)
解决方法:
同问题2