Let’s Encrypt でワイルドカード証明書を発行する方法

 

2018年3月14日からワイルドカード証明書に対応したらしい。

ワイルドカード証明書と ACME v2 へ対応

ACME v2 とワイルドカード証明書の技術情報

 

証明書発行手順

1.Certbot クライアントのインストール

省略、下記URL参照

https://letsencrypt.jp/usage/install-certbot.html

 

2.発行コマンド実行

# certbot certonly --manual --agree-tos --manual-public-ip-logging-ok --server https://acme-v02.api.letsencrypt.org/directory --preferred-challenges dns -d *.matumo.com -d matumo.com -m email@example.com

・wgetでcertbotをダウンロードした場合は、certbotコマンドが使用できないので、青字部分の certbot を ./certbot-auto に書き換える。

赤字部分は自分のドメインとメールアドレスに書き換える。

 

ここからはApache環境前提の説明

 

3.httpd.conf の設定

ホストドメインの設定を追加

<VirtualHost *:443>
 ServerName matumo.com
 DocumentRoot /var/www/matumo.com/
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/matumo.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/matumo.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/matumo.com/chain.pem
</VirtualHost>

サブドメインの設定を追加

<VirtualHost *:443>
 ServerName sub.matumo.com
 DocumentRoot /var/www/sub.matumo.com/
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/matumo.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/matumo.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/matumo.com/chain.pem
</VirtualHost>

 

赤字部分、青字部分は自分のものに書き換える。

青字部分はホストドメインとサブドメインで異なる箇所。

 

4.Apache再起動

service httpd restart

 

おわり

評価ありがとうございます。
記事の評価をお願いします。今後の参考にさせていただきます。
  • 役に立った (1)
  • まあまあだった (0)
  • 理解不能 (0)
  • 役に立たなかった (0)

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.