
エラー「Warning: The web server configuration check failed. Please fix the configuration」を乗り越えて、Amazon Lightsailsで運用しているmieruka.linkが無料で常時SSLに対応しました
おはようございます!mieruka.link管理人の伊集院です。
今回は、エラー「Warning: The web server configuration check failed. Please fix the configuration」を解消して、当サイトmieruka.linkを常時SSL化したよといったお話です。
つまり、上記エラーに遭遇した方及びBitnamiのbncert-toolを調べている方向けの記事です。
当サイトの運用開始2020年4月なのですが、実は本日までSSLは自己証明書を使っておりました・・・
本サイト、https://www.mieruka.link にアクセスするとブラウザの警告が出て、証明書を表示するとwww.example.comと記載された証明書が表示されており、折角検索サイトで当ブログをみつけクリックしても、そこで辞めてしまったという方も多くいらっしゃったかと思います。
アクセス数も順調に増え、毎日たくさんの方に閲覧されるサイトに成長したmieruka.link、流石にこれは恥ずかしいと一念発起し、無料で常時SSL化を実現する方法を調べておりました。
当サイトが利用しているAmazon LightsailのWordPressインスタンスは、Bitnamiと呼ばれるソフトウェアが予めインストールされております。
伊集院も詳細を知らないで使っていたのですが、Wikipediaによると
Bitnami is a library of installers or software packages for web applications and software stacks as well as virtual appliances. Bitnami is sponsored by Bitrock, a company founded in 2003 in Seville, Spain by Daniel Lopez Ridruejo and Erica Brescia.[1] Bitnami stacks are used for installing software on Linux, Windows, Mac OS X and Solaris.[2]VMware acquired Bitrock, along with its two largest properties, Bitnami and InstallBuilder, on May 15, 2019
https://en.wikipedia.org/wiki/Bitnami
つまりは、Webアプリケーション開発を強力に補助するソフトウェアらしいです。
ここからが肝ですが、このBitnamiの中に常時SSLを無料で実現してくれるコマンドが含まれているのです!!
bncert-toolで実現
Amazon LightsailのWordpressインスタンスにはデフォルトとで/opt/bitnami/配下にコマンドが存在します。
$man bncert-tool
No manual entry for bncert-toolmanページは用意されていなかったので、–helpオプションで実行してみました。
$ ./bncert-tool --help | more
Bitnami HTTPS Configuration Tool 0.6.1
Usage:
 --help                                                                  Display the list 
of valid options
 --version                                                               Display product i
nformation
 --unattendedmodeui <unattendedmodeui>                                   Unattended Mode U
I
                                                                         Default: none
                                                                         Allowed: none min
imal minimalWithDialogs
 --optionfile <optionfile>                                               Installation opti
on file
                                                                         Default: 
 --debuglevel <debuglevel>                                               Debug information
 level of verbosity
                                                                         Default: 2
                                                                         Allowed: 0 1 2 3 
4
 --mode <mode>                                                           Installation mode
                                                                         Default: text
                                                                         Allowed: qt gtk x
window text unattended
 --debugtrace <debugtrace>                                               Debug filename
                                                                         Default: 
 --installer-language <installer-language>                               Language selectio
n
                                                                         Default: en
                                                                         Allowed: sq ar es_AR az eu pt_BR bg ca hr cs da nl en et fi fr de el he hu id it ja kk ko lv lt no
 fa pl pt ro ru sr zh_CN sk sl es sv th zh_TW tr tk uk va vi cy
 --installdir <installdir>                                               Bitnami installation directory
                                                                         Default: 
--domains <domains>                                                     List of domains (separated by spaces)
                                                                         Default: 
 --enable_https_redirection <enable_https_redirection>                   Enable HTTP to HTTPS redirection
                                                                         Default: 1
 --enable_nonwww_to_www_redirection <enable_nonwww_to_www_redirection>   Enable non-www to www redirection
                                                                         Default: 1
 --enable_www_to_nonwww_redirection <enable_www_to_nonwww_redirection>   Enable www to non-www redirection
                                                                         Default: 0
 --dry_run <dry_run>                                                     Perform a dry run
                                                                         Default: 0
 --use_staging <use_staging>                                             Use Let's Encrypt staging server
                                                                         Default: 0
 --perform_public_ip_validation <perform_public_ip_validation>           Perform public IP address validation
                                                                         Default: 1
 --perform_dns_validation <perform_dns_validation>                       Perform DNS validation
                                                                         Default: 1
 --server_name <server_name>                                             Server name
                                                                         Default: 
 --configure_server_name <configure_server_name>                         Configure web server name to match provided value of server name
                                                                         Default: 1
 --manage_services <manage_services>                                     Stop and start services when needed
                                                                         Default: 1
 --email <email>                                                         E-mail address
                                                                         Default: 
 --accept_tos <accept_tos>                                               Agree to the Let's Encrypt Subscriber Agreement
                                                                         Default: 0
 --configure_cron <configure_cron>                                       Create a cron entry for renewing certificates each month
                                                                         Default: 1Bitnami HTTPS Configuration Toolが正式名称です。
様々なオプションがありますが、コマンドを引数なしで実行したときに選択を求められるオプションが多いです。
このコマンドを実行して、必要情報を入力すれば利用しているWordprssインスタンスを無料で常時SSL化できるといった便利な代物なのですが、筆者の環境では以下のようなエラーが出力され、先に進めませんでした。
$sudo ./bncert-tool
Bitnami installation directory
Please type a directory that contains a Bitnami installation. The default
installation directory for Linux installers is a directory inside /opt.
Bitnami installation directory
Warning: The web server configuration check failed. Please fix the configuration
error:
Press [Enter] to continue:Press [Enter] to continue: でEnterキーを押しても無限ループ状態です。
–debuglevel <debuglevel>オプションでデバックを試みましたが、上記のエラーと同じ標準出力でした・・・
そこで、Bitnamiのコミュニティフォーラムを確認すると、「再起動すれば治る」といった嘘みたいなおまじないチックな話がありました。
信じていいなかったのですが、結果的にAmazon LightsailのWordpressインスタンスの再起動後、もういちどコマンドを実行したら、アップデートの注意文が表示され、本エラーが解消。
無事常時SSL化をすることができました。
最新記事 by 伊集院 (全て見る)
- 【暗号化通信(TLS)を復元できる】WIRESHARK達人への道 第二十五歩 暗号化通信(TLS)を復号する方法 - 1月 1, 2023
- 【詳細版】NSM(ネットワークセキュリティモニタ)、Zeekとは? - 9月 1, 2022
- 【簡易版】OSSネットワークセキュリティモニタZeekとは? - 8月 26, 2022