~/.acme.sh/

alias acme.sh=~/.acme.sh/acme.sh

如果zsh報錯,在.zshrc中添加以下,并重載

vim ~/.zshrc

? setopt no_nomatch

source ~/.zshrc

如需申請阿里云" />

国产成人精品无码青草_亚洲国产美女精品久久久久∴_欧美人与鲁交大毛片免费_国产果冻豆传媒麻婆精东

18143453325 在線咨詢 在線咨詢
18143453325 在線咨詢
所在位置: 首頁 > 營銷資訊 > 建站知識 > 申請泛域名

申請泛域名

時間:2023-02-08 02:40:01 | 來源:建站知識

時間:2023-02-08 02:40:01 來源:建站知識

下載acme.sh工具

curl https://get.acme.sh | sh

~/.acme.sh/

alias acme.sh=~/.acme.sh/acme.sh

如果zsh報錯,在.zshrc中添加以下,并重載

vim ~/.zshrc

? setopt no_nomatch

source ~/.zshrc

如需申請阿里云 Api_key 和 Ali_Secret可參照如下

https://blog.xinshangshangxin.com/2018/03/22/wildcard-domain/

  1. 訪問 https://ram.console.aliyun.com
  2. 左側(cè)菜單點擊 用戶管理, 右上角點擊創(chuàng)建新用戶
  3. 填寫用戶名, 點擊確定, 注意保存 AccessKeyIdAccessKeySecret
4. 添加授權(quán)

*********特別注意: 以下使用ABC代替你的頂級域名**********

申請證書并添加TXT解析記錄

export Ali_Key="上面申請的AccessKeyId"

export Ali_Secret="上面申請的AccessKeySecret"

acme.sh --issue --dns dns_ali -d ABC -d *.ABC

使用更新命令來請求頒發(fā)泛域名證書

acme.sh --issue --dns dns_ali -d *.ABC --dnssleep 0 --force

生成pem證書

(記得 mkdir /etc/nginx/ssl)

acme.sh --install-cert -d ".ABC" --key-file "/etc/nginx/ssl/.ABC.key" --fullchain-file "/etc/nginx/ssl/*.ABC.pem" --reloadcmd "systemctl reload nginx"

編輯nginx.conf

http { include /etc/nginx/mime.types; default_type application/octet-stream; server { listen 80; listen 443; ssl on; # 配置你上面 --fullchain-file 的路徑 ssl_certificate /etc/nginx/ssl/*.ABC.cer; # 配置你上面 --key-file 的路徑 ssl_certificate_key /etc/nginx/ssl/*.ABC.key; location / { proxy_pass http://10.10.10.25; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } }之后重啟 nginx 即可

更新證書

目前證書在 60 天以后會自動更新, 你無需任何操作,不過都是自動的, 你不用關(guān)心.

更新 acme.sh

開啟自動升級

acme.sh --upgrade --auto-upgrade

關(guān)閉自動升級

acme.sh --upgrade --auto-upgrade 0

測試訪問

按需要,在寶塔中進行配置conf文件

查看定時任務(wù)

crontab -l




參考文檔:



關(guān)鍵詞:申請

74
73
25
news

版權(quán)所有? 億企邦 1997-2025 保留一切法律許可權(quán)利。

為了最佳展示效果,本站不支持IE9及以下版本的瀏覽器,建議您使用谷歌Chrome瀏覽器。 點擊下載Chrome瀏覽器
關(guān)閉