[Note]使用Letsencrypt申請Domain Wirdcard
近幾年我的網域憑證一直都用Letsencrypt
比較麻煩的地方是每三個月都要驗證一次
記錄一下,不然每次都要去Google找解法
如果是新安裝的要記得先新增repository
跟安裝certbot
~$ add-apt-repository ppa:certbot/certbot
~$ apt update && apt install certbot
接著要來下指令跑申請流程了
~# certbot certonly --manual -d *.example.com -d example.com --agree-tos --no-bootstrap --manual-public-ip-logging-ok --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory
沒意外應該會跑出類似下面的情況
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator manual, Installer None
Obtaining a new certificate
Performing the following challenges:
dns-01 challenge for example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please deploy a DNS TXT record under the name
_acme-challenge.example.com with the following value:
sdsdfj2812121m2n1nsmnsmnxzmxnzmxnzmxnzmxnzmxnzmxzx
Before continuing, verify the record is deployed.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue
這個地方是要做DNS
的驗證,證明你是這個網域的主人,像我自己就有架設DNS Server,所以可以很快速的完成這個動作
如果是使用domain 提供業者的DNS代管服務,請記得等一段時間確定可以用dig
解到之後再按Enter喔,因為
一按下去就會去驗證了
一按下去就會去驗證了
一按下去就會去驗證了
當按下Enter驗證後,沒意外他就會從外面解到剛剛的TXT Record,接著就會出現類似下方的畫面
Press Enter to Continue
Waiting for verification...
Cleaning up challenges
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/example.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/example.com/privkey.pem
Your cert will expire on 2019-02-27. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le