zoukankan      html  css  js  c++  java
  • ssl证书之certbot

    一.安装

    1.下载压缩包:
    #wget https://github.com/certbot/certbot/archive/master.zip

    2.解压包

    3.官方文档
    https://github.com/certbot/certbot

    二.创建证书

    创建的证书有90天的有效期,过期后需要续期

    1.创建单个证书
    ./certbot-auto certonly --webroot -w 网站目录 -d 域名

    2.创建多个证书
    ./certbot-auto certonly --webroot -w 网站目录1 -d 域名1 -w 网站目录2 -d 域名2


    ps:
    如果出现超时,可以再次执行命令

    三.使用(nginx示例)

    在server段配置:
    ssl on;
    ssl_certificate "/etc/letsencrypt/live/domain.com/fullchain.pem"; #请根据实际路径
    ssl_certificate_key "/etc/letsencrypt/live/domain.com/privkey.pem"; #请根据实际路径

    四.常用命令

    1.查看证书
    ./certbot-auto certificates

    2.续期(更新证书)
    #模拟更新证书
    ./certbot-auto renew --dry-run
    #实际更新证书
    ./certbot-auto renew

    #模拟更新单个证书
    ./certbot-auto renew --dry-run --cert-name domain.com
    #实际更新单个证书
    ./certbot-auto renew --cert-name domain.com

    3.吊销证书
    ./certbot-auto revoke --cert-path /etc/letsencrypt/live/domain.com/fullchain.pem

    4.certbot-auto每次运行都需要更新,如果保持版本锁定,增加--no-self-upgrade

    五.其他问题

    如果遇到Installing Python packages...卡主并报错

    新建

    ~/.pip/pip.conf

    写入以下内容(目的是更换pip源)

    [global]
    index-url = https://pypi.doubanio.com/simple/
    
    [install]
    trusted-host=pypi.doubanio.com
    

      

    更好的证书生成工具,免费一年

    https://github.com/acmesh-official/acme.sh

  • 相关阅读:
    hdu 4107 Gangster 线段树(成段更新)
    hdu 3037 Saving Beans (lucas定理)
    hdu 3944 DP? (Lucas 定理)
    hdu 5038 Grade 水
    ASP.NET Core 配置 MVC
    ASP.NET Core 静态文件
    ASP.NET Core 异常和错误处理
    ASP.NET Core 中间件
    ASP.NET Core 项目配置 ( Startup )
    ASP.NET Core 基本项目目录结构
  • 原文地址:https://www.cnblogs.com/itfenqing/p/10333399.html
Copyright © 2011-2022 走看看