<button id="g80sy"></button>
  • <abbr id="g80sy"></abbr>
  • <button id="g80sy"></button>
    <rt id="g80sy"><delect id="g80sy"></delect></rt>
  • 手動使用acme.sh以DNS方式申請免費SSL證書

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

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

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

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

    安裝完成后,會自動增加任務用于證書的自動更新

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


    二、手工申請證書:

      注:這種方法一般適用于DNS供應商不提供API的場景,且必須帶有參數--yes-I-know-dns-manual-mode-enough-go-ahead-please,且不能自動續期

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

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


    2、根據提示(會以綠色文字顯示)在DNS中創建所申請域名的對應的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解析生效后,執行以下命令

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


    4、申請成功,會提示證書文件存放位置:

    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"


    標簽:
    最后修改:2025-03-20 10:18:54

    非特殊說明,本博所有文章均為博主原創。

    主站蜘蛛池模板: 延川县| 饶河县| 濮阳市| 辽中县| 抚顺市| 佛山市| 栾城县| 高淳县| 贵港市| 蓝田县| 大石桥市| 富裕县| 鸡泽县| 玉林市| 汝阳县| 汤阴县| 凤冈县| 叶城县| 菏泽市| 祁连县| 密云县| 海林市| 凤阳县| 茌平县| 泸州市| 循化| 五家渠市| 周宁县| 德惠市| 台南县| 勐海县| 德保县| 谢通门县| 临澧县| 宜昌市| 小金县| 泾阳县| 石渠县| 石门县| 湘阴县| 胶州市|