<button id="g80sy"></button>
  • <abbr id="g80sy"></abbr>
  • <button id="g80sy"></button>
    <rt id="g80sy"><delect id="g80sy"></delect></rt>
  • 手動(dòng)使用acme.sh以DNS方式申請(qǐng)免費(fèi)SSL證書

    程序猿 2022-12-09 15:03:55 4278瀏覽 加載中

    一、安裝acme.sh(Let's Encrypt 客戶端)

    github:https://github.com/Neilpang/acme.sh

    wget -O -  https://get.acme.sh | sh

    安裝完成后,會(huì)自動(dòng)增加任務(wù)用于證書的自動(dòng)更新

    注意:使用acme.sh不必在root下操作,但建議在root下操作


    二、手工申請(qǐng)證書:

      注:這種方法一般適用于DNS供應(yīng)商不提供API的場(chǎng)景,且必須帶有參數(shù)--yes-I-know-dns-manual-mode-enough-go-ahead-please,且不能自動(dòng)續(xù)期

    1、首先配置好要申請(qǐng)證書的域名,例如:*.myimportantdomain.com,一般為10分鐘:

    acme.sh --issue --dns -d \
      *.myimportantdomain.com \
      --yes-I-know-dns-manual-mode-enough-go-ahead-please


    2、根據(jù)提示(會(huì)以綠色文字顯示)在DNS中創(chuàng)建所申請(qǐng)域名的對(duì)應(yīng)的TXT記錄,并等待DNS記錄生效,一般為10分鐘:

    Add the following TXT record:

    Domain: '_acme-challenge.myimportantdomain.com'

    TXT value: '123pXF6fDUM88pg14kY123D3AUc5Cd_YVYZ5znpnC38'

    Please be aware that you prepend _acme-challenge. before your domain

    so the resulting subdomain will be: _acme-challenge..myimportantdomain.com

    Please add the TXT records to the domains, and re-run with --renew.

    Please add '--debug' or '--log' to check more details.

    See: https://github.com/Neilpang/acme.sh/wiki/How-to-debug-acme.sh


    3、等待DNS解析生效后,執(zhí)行以下命令

    acme.sh --renew --dns \
      -d *.myimportantdomain.com
      --yes-I-know-dns-manual-mode-enough-go-ahead-please


    4、申請(qǐng)成功,會(huì)提示證書文件存放位置:

    Your cert is in  /root/.acme.sh/*.myimportantdomain.com/*.myimportantdomain.com.cer

    Your cert key is in  /root/.acme.sh/*.myimportantdomain.com/*.myimportantdomain.com.key 

    v2 chain.

    The intermediate CA cert is in  /root/.acme.sh/*.myimportantdomain.com/ca.cer

    And the full chain certs is there:  /root/.acme.sh/*.myimportantdomain.com/fullchain.cer

    _on_issue_success


    三、安裝證書:

    acme.sh --install-cert -d *.myimportantdomain.com \ 
      --key-file /usr/local/nginx/conf/*.myimportantdomain.com.key \ 
      --fullchain-file /usr/local/nginx/conf/*.myimportantdomain.com \
      --reloadCmd "nginx -s restart"


    標(biāo)簽:
    最后修改:2025-09-14 06:46:36

    非特殊說(shuō)明,本博所有文章均為博主原創(chuàng)。

    主站蜘蛛池模板: 讷河市| 贵定县| 江山市| 鲁甸县| 峨边| 鄂州市| 年辖:市辖区| 苗栗县| 房山区| 武威市| 丰都县| 大埔县| 嘉义县| 胶州市| 上饶县| 孟连| 济宁市| 大英县| 探索| 廉江市| 泰和县| 阿尔山市| 道孚县| 苏尼特右旗| 喀喇沁旗| 胶南市| 都兰县| 资源县| 阿城市| 囊谦县| 句容市| 泊头市| 隆昌县| 白水县| 三门峡市| 陇西县| 新泰市| 瑞安市| 彰武县| 台中市| 兰州市|