https 证书可以白嫖。没错,认识晚了。以下是在CentOS 7 下的实操。

安装

1
2
3
4
5
6
7
yum install epel-release

wget https://dl.eff.org/certbot-auto --no-check-certificate

chmod +x ./certbot-auto

./certbot-auto -n

生成证书

  • –webroot -w:网站运行的主目录
  • -d: 网站域名
    1
    ./certbot-auto certonly --webroot -w /home/www/ybphp -d www.ybphp.com

重载 conf 文件

nginx -s reload

重启 ngin x

service nginx restart