作成
【SSL】Let's Encrypt でサブドメインのDNS認証
#*#sub.hoge.com 用の SSL(Let's Encript)をDNS認証で取得する方法です。 IP制限, BASIC認証などかけているサイトなどに有用です。 ###title ①certbotコマンド ###command certbot certonly --manual -d sub.hoge.com --preferred-challenges dns ### ###command ret Please deploy a DNS TXT record under the name ... _acme-challenge.sub.hoge.com with the following value: 3SACbmTnYfJ7a7fycpB5PJlzK1-_Cr9j12345 ... Press Enter to Continue #### ###solve #*#"Press Enter to Continue" でまだ #R*+#"Enter をおさない"こと!放置!! ###title ②TXTレコードの設定 ### #+*#"sub.hoge.com" の場合、 #+#"_acme-challenge.sub.hoge.com" に 上記で取得した値を TXTレコードに設定します。 ###command _acme-challenge.sub.hoge.com. IN TXT "3SACbmTnYfJ7a7fycpB5PJlzK1-_Cr9j12345" ### GUI画面の場合は以下の感じ ###center (img://18/423m) ### そして、なんとなく30分ぐらい待ちます(たぶん10分ぐらいでいいと・・・) windows なら 以下を DOSプロンプトで対話形式でやると(linux なら dig ですね。) ###source > nslookup > set type=TXT > _acme-challenge.sub.hoge.com ### 以下のように値が帰ってくればそろそろ③に進む ###source ret _acme-challenge.sub.hoge.com text = "3SACbmTnYfJ7a7fycpB5PJlzK1-_Cr9j12345" ###title ③ Enter を押します。 ### ①で放置した状態の画面にたいし、Enter を押し処理を継続します。DNSにTXTレコードが反映される前にやるとエラーでやり直しになるので待っていました。 ###source (いい感じだと) Press Enter to Continue Waiting for verification... Cleaning up challenges ###title 確認 ###command ls /etc/letsencrypt/live/ ### あとは apacheなどの conf ファイルなどを変更! ###command (APACHEでの参考)
ServerName sub.hoge.com DocumentRoot /var/www/html/sub.hoge.com SSLCertificateFile /etc/letsencrypt/live/sub.hoge.com/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/sub.hoge.com/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf
wakatta 記法
投稿の仕方
基本的な記法
エンジニア向け記法
記法のサンプル
このコンテンツを見る