TOP

このエントリーをはてなブックマークに追加

https化(常時SSL化)



ホーム > 個人開発したことまとめ > https化


https化(常時SSL化)

SSL通信回りの仕組みがよくわかっていなかったので、自分のWebサイトを https 化することで勉強になるかなと思ったのでやってみた。


やったこと

以下のサイトの手順に従って SSL証明書を導入し、 https 化してみた。
さくらVPSにSSL証明書を導入しHTTPS通信の構築



ぶつかった壁とか学んだこととか

①https 化の設定完了後、httpd を再起動したらエラー

httpd[19419]: [Mon Dec 27 09:13:07.298143 2021] [so:warn] [pid 19419] AH01574: module ssl_module is already loaded, skipping
httpd[19419]: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf.d/vhost.conf:4
httpd[19419]: AH00526: Syntax error on line 9 of /etc/httpd/conf.d/vhost.conf:
httpd[19419]: Invalid command 'SSLMutex', perhaps misspelled or defined by a module not included in the server configuration
systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
kill[19421]: kill: cannot find process ""
systemd[1]: httpd.service: control process exited, code=exited status=1
systemd[1]: Failed to start The Apache HTTP Server.
systemd[1]: Unit httpd.service entered failed state.
systemd[1]: httpd.service failed.


上記の赤字部分について調べてみた。Apache2.4.x SSLMutexが廃止されたらしい。「/etc/httpd/conf.d/vhost.conf」の「SSLMutex default」をコメントアウトして「Mutex default ssl-cache」に修正。
修正したら事象は解消したものの、次は以下のエラーが発生。


httpd[20113]: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/httpd/conf.d/vhost.conf:4
httpd[20113]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443
httpd[20113]: no listening sockets available, shutting down
httpd[20113]: AH00015: Unable to open logs
systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
kill[20115]: kill: cannot find process ""
systemd[1]: httpd.service: control process exited, code=exited status=1
systemd[1]: Failed to start The Apache HTTP Server.
systemd[1]: Unit httpd.service entered failed state.
systemd[1]: httpd.service failed.


エラーは二つ。