zoukankan      html  css  js  c++  java
  • CentOS 7下给nginx安装SSL证书

    0. DNS要能解析你的网址(域名解析和主机解析,例如example.com和www.example.com都要能解析。注意泛解析记录*.example.com可以存在但在本文中暂时无法用于https[?需要certbot支持该DNS Provider。待考。?])

    1. 添加epel源,方法自行google;

    2. 访问https://letsencrypt.org/getting-started/,根据其提供的链接跳转到certbot,根据提示选择CentOS 7和nginx,可看到安装步骤;

    3. 安装certbot:

        # yum install python2-certbot-nginx

    4. 修改nginx配置文件,在server节的server_name变量添加服务器名称:

        server_name localhost example.com www.example.com

    5. 执行certbot:

         # certbot --nginx

         根据提示完成操作,注意按提示备份文件。

    6. 重新启动nginx

    7. 访问www.example.com测试

    Q & A

    Q1. certbot提示缺少urllib3

    A1. pip install urllib3

    Q2. certbot提示缺pyOpenSSL

    A2. pip install pyOpenSSL

    Q3. 已安装urllib3和pyOpenSSL的最新版本,但仍提示版本过低,或缺这两个模块(之一)。

    A3. 此种情况可能是因为yum和pip同时安装了urllib3和pyOpenSSL。

          可使用yum list installed和pip list install检查。

          从yum侧强制删除这两个模块(rpm -e --nodeps),从pip侧uninstall这两个模块然后重新pip install。

    Q4. certbot生成了密钥但提示Unable to install the certificate

    A4. nginx的server节中server_name变量需要包含你的域名条目和主机条目。

  • 相关阅读:
    ButterKnife不同版本配置
    【转载】RecyclerView源码解析
    【转载】RecyclerView使用全解析
    RecyclerView 和 ListView 使用对比分析
    apk瘦身
    【转载】图片压缩最优方案
    file.listFiles()按文件大小、名称、日期排序方法
    git命令
    Android中由Handler和内部类引起的内存泄漏
    查看Android手机数据库
  • 原文地址:https://www.cnblogs.com/byeyear/p/9465080.html
Copyright © 2011-2022 走看看