Let’s Encryptに新しいドメインを追加し、証明書を発行する

中間証明書の期限切れで大荒れしているLet’s Encrypt(笑)

個人ベースの利用では古い端末からのアクセスは考えるほどもありませんので、まったく問題なし。超便利なのでそのまま使い続けます♪

で、Let’s Encrypt稼働中のサーバに、ドメインを追加する方法です。
大前提として、こちらのように、Let’s Encryptが稼働している状態をまず作ります。

コマンド

sudo certbot --apache

追加の場合も同じ(笑)アパッチから情報を引っ張ってきます。

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache

Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: hogehoge.jp
2: www.hogehoge.jp
3: monmon.jp
4: www.monmon.jp
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 

新しいドメインが追加されているので、セパレータはスペースでよさげですので、1と2であれば、 1 2 といった感じで入力ですね。

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 

これも以前とかわらずhttpからhttpsに強制転送するかですので、私の場合は2っす。

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/hogehoge.jp/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/hogehoge.jp/privkey.pem
   Your cert will expire on 2022-01-18. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. 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

これにて無事、 /etc/letsencrypt/live/hogehoge.jp/ 配下に発行されました。

Apacheの設定

/etc/apache2/sites-available/hogehoge.jp-le-ssl.conf

相変わらず自動で設定ファイルが作成されてまして(笑)

https://hogehoge.jp

アクセスできている状態でした♪ 楽ちん。