`
JasonShieh
  • 浏览: 521093 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

使用certbot为你的网站免费上https

 
阅读更多

Certbot 使用方法
Certbot 的官方网站是 https://certbot.eff.org/ ,打开这个链接选择自己使用的 web server 和操作系统,EFF 官方会给出详细的使用方法,如下图

开始安装https
假设运行环境为centos7.1,Web 服务器是 Nginx 1.12.0(因为我的生产环境是),当前工作目录为 /root

获取certbot客户端
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
停止nginxyunx
service nginx stop
生成证书
./certbot-auto certonly --standalone --email `你的邮箱地址` -d `你的域名地址`
当前网站有多个域名时需在后面增加,例如

./certbot-auto certonly --standalone --email `你的邮箱地址` -d `你的域名1` -d `你的域名2`
查看生产的证书
tree /etc/letsencrypt/live/
将证书用于nginx
在nginx网站配置文件中增加

# TLS 基本设置
ssl_certificate /etc/letsencrypt/live/www.just4fun.site/fullchain.pem;#证书位置
ssl_certificate_key /etc/letsencrypt/live/www.just4fun.site/privkey.pem;# 证书位置
启动nginx

service nginx start
至此https配置完成

证书续签
Let’s Encrypt 生成的免费证书为3个月时间,但是我们可以无限次续签证书

./certbot-auto renew

作者:安小下
链接:https://www.jianshu.com/p/fb3733cd0d3b
來源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics