raspberry pi の apache2 にSSL/TLSを設定したら Action 'start' failed.

raspberry pi 5 の apache2 に SSLを設定したら下記のメッセージで起動しなくなった

# systemctl status apache2
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Action 'start' failed.
The Apache error log may have more information.

今回問題になったのは ServerName 未記載の AH00558 ではなく
/var/log/apache2/error.log に記載があった SSL Library Error
AH02562: Failed to configure certificate drive5:443:0 (with chain), check /etc/apache2/ssl/server.crt
SSL Library Error: error:0A00018F:SSL routines::ee key too small
キーが短いと...

検索で上がってくる ssl 設定例に
# openssl genrsa -des3 -out server.key 1024
というのがあり、ここのキーが短すぎるらしい

# openssl genrsa -des3 -out server.key 2048
で作成し直したら問題なく起動しました

コメント