LetsEncryptでの更新始末

上手く更新できない場合の対処

という記事を掲載しましたが、このプログラムを起動すると、

本サイトがになってますね。

何が起こったかは、LetsEncryptのログを調べればわかります。当該部分だけ、

certbot.errors.PluginError: Could not bind TCP port 80 because it is already in use by another process on this system (
such as a web server). Please stop the program in question and then try again.

TCP port 80が他のプロセスに使われていて、疎通ができんからアボートします。と言ってるので、これはあるあるで、ヒントも書いてありますが、web serverとかだというので、apache2様に一時的に止まってもらいます。

systemctl stop apache2
certbot renew
systemctl restart apache2

でおけです。無事。

この時のログは、

2025-10-04 17:33:13,465:DEBUG:certbot._internal.display.obj:Notifying user: Congratulations, all renewals succeeded:
2025-10-04 17:33:13,465:DEBUG:certbot._internal.display.obj:Notifying user:   /etc/letsencrypt/live/ghost.mydns.jp/fullchain.pem (success)

コマンドライン上は、

root@fenix:/var/log/letsencrypt# systemctl stop apache2
root@fenix:/var/log/letsencrypt# certbot renew
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Processing /etc/letsencrypt/renewal/ghost.mydns.jp.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Renewing an existing certificate for ghost.mydns.jp

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations, all renewals succeeded:
  /etc/letsencrypt/live/ghost.mydns.jp/fullchain.pem (success)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

めでたしめでたし。certbotの入れ方によっては、ポート80を巡ってapache2と衝突する可能性はあります。というのもcertbotのポートは80固定なのでね。その場合は、このような手順で解決できます。

コメント