跳转至内容
  • 版块
  • 最新
  • 标签
  • 称号
  • 广告
  • 商家收集
  • 帮助中心
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(不使用皮肤)
  • 不使用皮肤
折叠

HostEvaluate BBS

  1. HostEvaluate BBS
  2. 教程
  3. 使用certbot便捷管理网站lets-encrypt证书

使用certbot便捷管理网站lets-encrypt证书

已定时 已固定 已锁定 已移动 教程
sslhttpscertbotlets encrypt
1 帖子 1 发布者 79 浏览 1 关注中
  • 从旧到新
  • 从新到旧
  • 最多赞同
回复
  • 在新帖中回复
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • fanyixinwenundefined 离线
    fanyixinwenundefined 离线
    fanyixinwen
    萌新
    写于 最后由 编辑
    #1

    不管是通信安全还是搜素引擎收录需要,SSL证书现在基本是建站的标配了。除了通过宝塔等面板申请和管理Let’s Encrypt证书,现在也可以通过certbot,非常简便。

    官网:
    https://certbot.eff.org/lets-encrypt/debianjessie-nginx

    1.png

    根据自己使用的网页服务器类型和操作系统,系统会自动匹配相应代码:
    2.png

    3.png

    然后按照页面提示一步步操作就行了。


    下面以nginx和Debian9为例说明:

    • 移除系统已有的certbot:
    apt-get remove certbot
    
    • 安装certbot:
    wget https://dl.eff.org/certbot-auto
    mv certbot-auto /usr/local/bin/certbot-auto
    chown root /usr/local/bin/certbot-auto
    chmod 0755 /usr/local/bin/certbot-auto
    
    • 自动申请证书并整合进入nginx:
    /usr/local/bin/certbot-auto --nginx
    

    具体安装中,会要求输入邮箱,同意协议、订阅EFF信息,并确认域名、是否强制跳转https。

    Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    1: No redirect - Make no further changes to the webserver configuration.
    2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
    new sites, or if you're confident your site works on HTTPS. You can undo this
    change by editing your web server's configuration.
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
    Redirecting all traffic on port 80 to ssl in /etc/nginx/conf.d/translatorsnews.com.conf
    

    注意证书的保存位置和到期日:

     - Congratulations! Your certificate and chain have been saved at:
       /etc/letsencrypt/live/translatorsnews.com/fullchain.pem
       Your key file has been saved at:
       /etc/letsencrypt/live/translatorsnews.com/privkey.pem
       Your cert will expire on 2020-05-07.
    
    • 最后设置证书自动更新:
    echo "0 0,12 * * * root python -c 'import random; import time; time.sleep(random.random() * 3600)' && /usr/local/bin/certbot-auto renew" | sudo tee -a /etc/crontab > /dev/null
    

    现在打开网站看看,是不是已经有小锁了?

    你还可以通过这个网站进一步验证网站的安全性: https://www.ssllabs.com/ssltest/

    4.png

    https://iplc.best

    1 条回复 最后回复
    回复
    • 在新帖中回复
    登录后回复
    • 从旧到新
    • 从新到旧
    • 最多赞同


    赞助商广告

    热门标签

    水墨云
    633 个主题
    iplc
    528 个主题
    绿云
    483 个主题
    nat
    448 个主题
    合租
    427 个主题
    香港
    392 个主题
    碳云
    350 个主题
    广移
    319 个主题

    分类

    • 水区

    • 主机交易

      二手小鸡交换中 ···

      交易
      出租/合租
      电子垃圾
      交易争议

    • 主机信息

      主机优惠信息及AFF集合地

      官方 Offer
      测评跑分
      教程

    • 友商介绍

    • 公告

    2

    在线

    9.3k

    用户

    33.5k

    主题

    92.0k

    帖子
    • 登录

    • 没有帐号? 注册

    • 登录或注册以进行搜索。
    • 第一个帖子
      最后一个帖子
    0
    • 版块
    • 最新
    • 标签
    • 称号
    • 广告
    • 商家收集
    • 帮助中心