1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

LightsailでのSSL証明書更新でつまずいた

Posted at

Lightsailサーバ上にWordPressサイトを構築しているのですがLet's Encryptで作成したSSL証明書の有効期限が近づいてきました。

元々AWSのページを参考にSSL証明書を作成していたので同じくAWSのサイトをもとに更新しようとしたところ、やはりページに記載がある通りに行なっただけではうまくいかずエラーが・・・😢

具体的な作業

certbotを利用してSSL証明書を発行していたので、以下のコマンドでauthenticatorパラメータ値を確認してみました。

sudo cat /etc/letsencrypt/renewal/[DOMAIN].conf

authenticatorの値はstandaloneだったので以下のコマンドを実行

sudo /opt/bitnami/ctlscript.sh stop
sudo certbot renew
sudo /opt/bitnami/ctlscript.sh start

standaloneで設定しているとWebサーバを一度停止させないといけません。停止させずにrenewさせると"Problem binding to port 80"のエラーが発生します。

Webサーバを停止せずに更新する方法はないの?

わざわざサーバ停止させないといけないのか・・・と思っていたところ、以下の記事を発見。

ということで、standalone→webrootに設定を変更しました。

certbot certonly --webroot -w [DOMAINルートフォルダ] -d [ドメイン名]

これで解決👍

自動的に更新したい

今回はauthenticatorパラメータを変更したので手作業で行いましたが次回SSL更新は自動的にやって欲しいので、今後cron設定でcertbot renewをバッチ処理させようと思います。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?