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.

OpenLiteSpeedのあるサーバーでLetsEncrypt証明書の更新エラー

Posted at

OpenLiteSpeedの動いているサーバーで、Let's Encryptの更新が出来ない問題が発生したので、解決までの備忘録です。

$ /usr/bin/certbot renew
Cert is due for renewal, auto-renewing...
Plugins selected: Authenticator standalone, Installer None
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
Renewing an existing certificate for a.example.com
Performing the following challenges:
http-01 challenge for a.example.com
Cleaning up challenges
Failed to renew certificate a.example.com with error: Problem binding to port 80: Could not bind to IPv4 or IPv6.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
All renewals failed. The following certificates could not be renewed:
  /etc/letsencrypt/live/a.example.com/fullchain.pem (failure)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1 renew failure(s), 0 parse failure(s)

LiteSpeedがポート80を使っていたので、それが原因だった模様。

$ sudo lsof -i :80
COMMAND     PID   USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
litespeed 21038   root   28u  IPv4 29001210      0t0  TCP *:webcache (LISTEN)
litespeed 21038   root   29u  IPv4 29001211      0t0  TCP *:webcache (LISTEN)
litespeed 21038   root   30u  IPv4 29001212      0t0  TCP *:webcache (LISTEN)
litespeed 21038   root   31u  IPv4 29001213      0t0  TCP *:webcache (LISTEN)
litespeed 21038   root   32u  IPv4 29001214      0t0  TCP *:webcache (LISTEN)
litespeed 21038   root   33u  IPv4 29001215      0t0  TCP *:webcache (LISTEN)
litespeed 21042 nobody   28u  IPv4 29001210      0t0  TCP *:webcache (LISTEN)
litespeed 21043 nobody   29u  IPv4 29001211      0t0  TCP *:webcache (LISTEN)
litespeed 21044 nobody   30u  IPv4 29001212      0t0  TCP *:webcache (LISTEN)
litespeed 21045 nobody   31u  IPv4 29001213      0t0  TCP *:webcache (LISTEN)
litespeed 21046 nobody   32u  IPv4 29001214      0t0  TCP *:webcache (LISTEN)
litespeed 21047 nobody   33u  IPv4 29001215      0t0  TCP *:webcache (LISTEN)

LiteSpeedの管理画面から、HTTPListenerのPortを 80 -> 8080 に変更し、再起動。
image.png

ポート80が無くなるかチェック。

$ sudo lsof -i :80

ポート80を使っているタスクを止めてみるとか。

$ sudo kill -9 $(sudo lsof -t -i:80)

駄目だったら、コマンドラインからLiteSpeedを止めてみる。

$ /usr/local/lsws/bin/lswsctrl stop

改めて renew してみる。

$ /usr/bin/certbot renew

うまく更新できたら、LiteSpeedを再起動。

$ /usr/local/lsws/bin/lswsctrl restart
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?