- いつも忘れるんだが、Let’s encryptは SSL証明書を更新しないといけない
"Let’s EncryptのSSL証明書の有効期限は3ヶ月間ですので、3ヶ月に1度はSSL証明書を取得し直す必要があります"
やり方は簡単
- rootで
certbot renew
と入力するだけ - ただし nginx が動いていると port 80を使われるからエラーで怒られる
- rootで
Failed to renew certificate hogehoge.com with error: 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.
だから nginxを停止してから certbot renew し、nginxを再起動すればいい
sudo systemctl stop nginx sudo certbot renew sudo systemctl start nginx
- ここみるとhttps://zenn.dev/noraworld/articles/auto-renew-letsencrypt-for-nginx-reverse-proxies
- nginx動かしながら renewするやり方が書いてあるがめんどい
- またngnixや他のウェブアプリの証明書が更新されないだろうから意味が乏しい
- 証明書を renewしたら当然nginxやwebアプリも再起動してね