免費https證書申請

https證書申請

通過Let' s Encrypt進行免費https證書申請

  1. 官網網站
    首先在動手前,可以先去certbot看看,我覺得還是很有必要的啦!
  2. 安裝certbot

    yum install epel-release -y
    yum install certbot
  3. 通配符證書申請命令
    執行命令中會去驗證域名的所有者,也就是添加一條TXT記錄到域名控制檯。
    certbot certonly  -d *.test.com --manual --preferred-challenges dns --server https://acme-v02.api.letsencrypt.org/directory

    完成後會顯示域名所在目錄

4、自動續期

echo "0 0,12 * * * root python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew" | sudo tee -a /etc/crontab > /dev/null

默認到期前30天續期,如果不滿足可手動配置
/etc/letsencrypt/renewal/test.conf

5、證書清理
如果不想要了或者其他原因需要清理,執行以下命令即可

rm -rf /etc/letsencrypt/live/www.example.com/
rm -rf /etc/letsencrypt/archive/www.example.com/
rm /etc/letsencrypt/renewal/www.example.com.conf
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章