gikoha’s blog

個人的メモがわり

certbot renew for nginx

  • いつも忘れるんだが、Let’s encryptSSL証明書を更新しないといけない
  • "Let’s EncryptSSL証明書の有効期限は3ヶ月間ですので、3ヶ月に1度はSSL証明書を取得し直す必要があります"

  • やり方は簡単

    • rootでcertbot renewと入力するだけ
    • ただし nginx が動いていると port 80を使われるからエラーで怒られる
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