blog20100901

2013/08/20 - プログラミング言語 Perl にまつわる etc. - Perl monger
参考 : perldoc, perldoc.jp, search.cpan.org, perldoc.perl.org ...
「 初めての Perl 第 6 版 」(オライリー・ジャパン発行 ISBN978-4-87311-567-2) 」
「 続・初めての Perl 改訂版 」(オライリー・ジャパン発行 ISBN4-87311-305-9) 」
「 Effective Perl 第 2 版 」(翔泳社発行 ISBN978-4-7981-3981-4) 」 ... etc,.

Perl Perl_7 Web Server memo

MEMO: Apache2.4 に ModSecuity2.9 を追加する作業 (d218)

目次 - Perl Index


Theme



Perl について、復習を兼ねて断片的な情報を掲載して行く連載その d218 回。

今回は, Ubuntu 20.04 上で Apache HTTP Sever 2.4 (httpd) と ModSecurity 2.9.5 (mod_security) のソースインストールを行う際に遭遇したエラーや警告等の問題とその解決方法についてメモをします。

$ lsb_release -a
LSB Version: core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 20.04.3 LTS
Release: 20.04
Codename: focal
sela@selarabird:~$ lsb_release
LSB Version: core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch

この記事では、はじめに今回の作業で「必要とされたソフトウェア, ライブラリ」、次に「発生した問題と原因および解決策」を列挙します。これに続いて「ほぼ時系列の作業記録」をメモしました。

今日のあなたといつかのわたしの役に立てれば幸いです。





LIST: 必要とされたソフトウェア, ライブラリ



はじめに, Ubuntu 20.04 上で Apache HTTP Server (httpd) をソースからインストールして ModSecurity (mod_security これもソースから) を追加する際に必要とされたソフトウェアとライブラリおよび configure 時のオプションをリストします。

必要とされたソフトウェア, ライブラリは以下のものでした。

make :コンパイルを指示するためのユーティリティ. 汎用の依存関係解決器
cmake :クロスプラットフォーム, オープンソースの make システム
gcc :GNU C コンパイラ.
build-essential :Debian パッケージのビルドに不可欠な情報リスト
libpcre3 :Old Perl 5 互換の正規表現 (PCRE) のランタイムファイルライブラリ
libpcre3-dev :PCRE の開発ファイル (ヘッダ, 静的ライブラリ, ドキュメント)
libssl-dev :SSL ツールキットの開発ファイル (ヘッダ, 静的ライブラリ, ドキュメント)
libexpat1-dev :ストリーム指向の XML パーサ Expat 用の C ライブラリ - 開発キット
libxml2-dev :開発用の GNOME XML ライブラリ
libcurl4-openssl-dev :libcurl (OpenSSSL フレーバ) の開発用ファイルとドキュメント

これらのインストールには、Ubuntu のパッケージ管理ソフトウェアのコマンドラインインターフェースである「 apt 」を利用しました。

必要とされた configure オプションは以下のものです。

httpd configure options

--with-openssl=/usr/lib/ssl
--with-crypto
--with-expat=/usr/lib/x86-64-linux-gnu
--enable-mpms-shared=all --enable-mods-shared=all
--enable-ssl
--with-included-apr

modsecurity configure options

--with-apxs=/usr/local/apache2/bin/apxs
--with-apr=/usr/local/apache2/bin/apr-1-config
--with-apu=/usr/local/apache2/bin/apu-1-config



LIST: 発生した問題の原因とその解決策



httpd と modsecurity それぞれの configure, make および make test において発生した問題とその解決策をリストします。


httpd configure




  • エラー: APR が見つからない。


    configure: error: APR not found. Please read the documentation.


    原因: Apache 2.4 から httpd のソースに APR が含まれなくなった。


    解決策: APR 公式サイトから APR, APR-Util, APR iconv をダウンロードしてインストール。手元の環境では httpd ソースディレクトリの srclib/ に APR シリーズを配置して httpd の configure オプション「 --with-included-apr 」とともにコンパイル。


  • エラー: libpcre が見つからない。


    configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/


    原因: libpcre が未インストール。


    解決策: libpcre3, libpcre3-dev をインストール。


    $ sudo apt install libpcre3
    $ sudo apt install libpcre3-dev


  • エラー: 前提条件の障害により mod_ssl がビルドできなかった。


    configure: WARNING: OpenSSL version is too old no checking whether to enable mod_ssl... configure: error: mod_ssl has been requested but can not be built due to prerequisite failures


    原因: libssl-dev が未インストール。


    解決策: libssl-dev をインストール。


    $ sudo apt install libssl-dev


  • エラー (make): expat.h がない。


    xml/apr_xml.c:35:10: fatal error: expat.h: No such file or directory
    35 | #include <expat.h>
    | ^~~~~~~~~
    compilation terminated.


    原因: libexpat1-dev が未インストール。


    解決策: libexpat1 をインストール。


    $ sudo apt install libexpat1-dev





modsecurity configure




  • NOTE: curl ライブラリが見つからない。


    checking for libcurl config script... no
    configure: *** curl library not found.
    configure: NOTE: curl library is only required for building mlogc
    configure: NOTE: mlgoc compilation was disabled.


    原因: libcurl4-openssl-dev が未インストール。


    解決策: libcurl4-openssl-dev をインストール。


    $ sudo apt install libcurl4-openssl-dev


  • エラー: apr ライブラリが必要とされている。


    checking for libapr config script... no
    configure: *** apr library not found.
    configure: error: apr library is required


    原因: ARP config スクリプトが見つからない。


    解決策: configure 時に APR config スクリプトへのパスを指定する。


    --with-apr=/PATH/TO/apr-1-config


  • エラー: apu ライブラリが必要とされている。


    checking for libapu config script... no
    configure: *** apu library not found.
    configure: error: apu library is required


    原因: ARP-Util config スクリプトが見つからない。


    解決策: configure 時に APR-Util config スクリプトへのパスを指定する。


    --with-apu=/PATH/TO/apu-1-config


  • 警告: APR-Util が crypto サポートされていないので SecRemoteRule は 'crypto' パラメータをサポートしない。


    configure: WARNING: APR util was not compiled with crypto support. SecRemoteRule will not support the parameter 'crypto' checking that generated files are newer than configure... done


    原因: APR-Util が cyrpto をサポートするように構成されていない。


    解決策: httpd の configure 時に APR-Util が crypto をサポートするオプションを指定する。


    --with-openssl=/usr/lib/ssl --with-crypto


  • エラー (make test): libaprutil で XML_* への未定義の参照が行われている。


    /usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_SetUserData'
    /usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_ParserFree'
    /usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_ParserCreate'
    /usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_Parse'
    /usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_GetErrorCode'
    /usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_SetElementHandler'
    /usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_SetCharacterDataHandler'
    /usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_SetEntityDeclHandler'
    /usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_ErrorString'
    /usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_StopParser'
    collect2: error: ld returned 1 exit status
    make[2]: *** [Makefile:837: msc_test] Error 1
    make[2]: Leaving directory '/usr/local/src/modsecurity-2.9.5/tests'
    make[1]: *** [Makefile:1605: check-am] Error 2
    make[1]: Leaving directory '/usr/local/src/modsecurity-2.9.5/tests'
    make: *** [Makefile:501: check-recursive] Error 1


    原因: httpd にバンドルした apr-util で XML 関連ライブラリが不足している。


    解決策: httd の configure 時に APR-Util が libexpat の場所を認識できるようにする。


    --with-expat=/usr/lib/x86-64-linux-gnu






以下の項目はほぼ時系列で行った作業, 遭遇した問題, 問題の解決方法の実行を記述したものです。


Apache httpd で遭遇した問題と対策



APACHE HTTP SERVER httpd のインストールを準備します。

make と cmake をインストール。

$ sudo apt install make
$ sudo apt install cmake


GCC, C++ コンパイラをインストール。

$ sudo apt isntall gcc
$ sudo apt isntall build-essential


公式サイト https://httpd.apache.org/download.cgi より httpd-2.4.52.tar.gz と httpd-2.4.52.tar.gz.sha256 をダウンロード。sha256sum で検証。tar で展開。

$ cd /usr/local/src
$ sudo wget https://dlcdn.apache.org//httpd/httpd-2.4.52.tar.gz
$ sudo wget https://downloads.apache.org/httpd/httpd-2.4.52.tar.gz.sha256
$ sudo sha256sum -c httpd-2.4.52.tar.gz.sha256
httpd-2.4.52.tar.gz: OK
$ sudo tar xvfz httpd-2.4.52.tar.gz



At the time of `configure'



httpd の構成「 ./configure 」を行います。最初に以下を実行しました。

$ cd /usr/local/httpd-2.4.52
$ sudo ./configure --enable-mpms-shared=all --enable-mods-shared=all --enable-ssl

configure オプション。

--enable-mpms-shared=all :すべての (all) MPM を動的共有モジュールとして有効化
--enable-mods-shared=all :すべての (all) 動的共有モジュールを有効化する (真の all は reallyall)
--enable-ssl :SSL/TLS サポート



エラー: APR not found



発生したエラー。Apache 2.4 から APR (Apache Portable Runtime) が同梱されなくなったことによるエラーとのこと。

...
configure: error: APR not found. Please read the documentation.
...


APR, APR-Util, APR iconv を公式 https://apr.apache.org/download.cgi からダウンロード。sha256 検証。

$ cd /usr/local/src
$ sudo wget https://dlcdn.apache.org//apr/apr-1.7.0.tar.gz
$ sudo wget https://www.apache.org/dist/apr/apr-1.7.0.tar.gz.sha256
$ sudo sha256 -c apr-1.7.0.tar.gz.sha256
apr-1.7.0.tar.gz: OK
# 以下 APR-Util, APR iconv も同様


アーカイブを展開。

$ sudo tar xvzf apr-1.7.0.tar.gz
$ sudo tar xvzf apr-iconv-1.2.2.tar.gz
$ sudo tar xvzf apr-util-1.6.1.tar.gz


httpd と共にコンパイルするために、上記で展開した各ディレクトリを httpd-2.4.52/srclib/ 配下に移動します。

$ cd /usr/local/src
$ sudo mv apr-1.7.0 httpd-2.4.52/srclib/apr
$ sudo mv apr-util-1.6.1 httpd-2.4.52/srclib/apr-util
$ sudo mv apr-iconv-1.2.2 httpd-2.4.52/srclib/apr-iconv


オプション「 --with-included-apr 」を追加して再度 configure。

$ sudo ./configure --enable-mpms-shared=all --enable-mods-shared=all --enable-ssl --with-included-apr



エラー: libpcre not found



発生したエラー。

...
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/


libpcre3 と libpcre3-dev をインストールします。

$ sudo apt install libpcre3 libpcre3-dev


再度 configure。

$ sudo ./configure --enable-mpms-shared=all --enable -mods-shared=all --enable-ssl --with-included-apr



エラー: mod_ssl has been requested



発生したエラー。

...
configure: WARNING: OpenSSL version is too old no checking whether to enable mod_ssl... configure: error: mod_ssl has been requested but can not be built due to prerequisite failures


OpenSSL のバージョンが古いと警告がでましたが libssl-dev のインストールで解決するようです。

$ sudo apt install libssl-dev


再度 configure。

$ sudo ./configure --enable-mpms-shared=all --enable -mods-shared=all --enable-ssl --with-included-apr
...
configure: summary of build options:

Server Version: 2.4.52
Install prefix: /usr/local/apache2
C compiler: gcc
CFLAGS: -g -O2 -pthread
CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE
LDFLAGS:
LIBS:
C preprocessor: gcc -E


問題ないように見えました。


At the time of `make'



httpd の make を行います。

$ sudo make



エラー: expat.h: No such file or directory



httpd の make で以下のエラーが発生しました。

...
xml/apr_xml.c:35:10: fatal error: expat.h: No such file or directory
35 | #include <expat.h>
| ^~~~~~~~~
compilation terminated.
...


libexpat1-dev をインストール。

$ sudo apt install libexpat1-dev


再度 configure を実行。

$ sudo ./configure --enable-mpms-shared=all --enable-mods-shared=all --enable-ssl --with-included-apr
...
configure: summary of build options:

Server Version: 2.4.52
Install prefix: /usr/local/apache2
C compiler: gcc
CFLAGS: -g -O2 -pthread
CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE
LDFLAGS:
LIBS:
C preprocessor: gcc -E


問題はなさそうに見えました。

再度 make。

$ sudo make


問題なさそうだったので make install。

$ sudo make install


make install も問題なく完了したように見えました。

実際にこの後に httpd を start して CGI や Virtual Host, Proxy 設定などを試しましたが問題はありませんでした。


ModSecurity (mod_security) で遭遇した問題と対策



公式 https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-%28v2.x%29#installation-for-apache を確認しつつ必要とされるライブラリをインストールします。

Prerequisites
mod_unique_id
libapr
libaprutil
libpcre
libxml2
liblua v5.x.x (optional)
libcur v7.15.1 or higher


httpd インストール時に libapr, libaprutil, libpcre はインストール済みになっているはずであり, liblua と libcur はオプショナルのように読めたので, ここでは libxml2 をインストールします。

$ sudo apt install libxml2-dev


公式 https://github.com/SpiderLabs/ModSecurity の右カラム「 Release 」より「 latest 」マークをクリックしてページを移動。今回は「 v2.9.5 」https://github.com/SpiderLabs/ModSecurity/releases/tag/v2.9.5 の「 Assets 」より「 modsecurity-2.9.5.tar.gz 」をダウンロードしました。

ダウンロード, 検証, 展開。

$ cd /usr/local/src
$ sudo wget https://github.com/SpiderLabs/ModSecurity/releases/download/v2.9.5/modsecurity-2.9.5.tar.gz
$ sudo wget https://github.com/SpiderLabs/ModSecurity/releases/download/v2.9.5/modsecurity-2.9.5.tar.gz.sha256
$ sha256sum -c modsecurity-2.9.5.tar.gz.sha256
modsecurity-2.9.5.tar.gz: OK
$ sudo tar xzf modsecurity-2.9.5.tar.gz



At the time of `configure'



ModSecurity 公式によれば Apache httpd へのインストールは「 --with-apxs 」オプションのみでよさそうに見えたので以下で configure を実行しました。

$ cd modsecurity-2.9.5/
$ sudo ./configure --with-apxs=/usr/local/apache2/bin/apxs



NOTE: curl library not found.



エラーではありませんが以下のメッセージを確認しました。

...
checking for libcurl config script... no
configure: *** curl library not found.
configure: NOTE: curl library is only required for building mlogc
configure: NOTE: mlgoc compilation was disabled.
...


「 mlogc 」(ModSecurity Log Collecter) というログ送信機能を使うために libcurl が必要とのことです。現状 mlogc を使う予定はありませんが, libcurl は他でも必要とされる可能性があるので対応します。

libcurl4 はすでにインストール済みでしたので, libcurl4-openssl-dev をインストールしておきました。

$ sudo apt install libcurl4-openssl-dev


これで上記 libcurl に関する NOTE は解消されました。


エラー: apr library is required



configure では前項の「 NOTE: curl library not found 」と共に以下のエラーが発生しました。

$ sudo ./configure --with-apxs=/usr/local/apache2/bin/apxs
...
checking for libapr config script... no
configure: *** apr library not found.
configure: error: apr library is required


Apache httpd ソースの srclib/ に APR をバンドルしてコンパイルした場合には APR config スクリプトへのパス「 --with-apr=/PATH/TO/apr-1-config 」 のオプションが必要になるそうなので, これを追加して再度 configure。

$ sudo ./configure --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apache2/bin/apr-1-config
...
checking for libapu config script... no
configure: *** apu library not found.
configure: error: apu library is required



エラー: apu library is required



今度は apu (APR-util) へのパスが必要なエラーが発生したので、APR util config スクリプトへのパス「 --with-apu=/PATH/TO/apu-1-config 」を追加して再度 configure します。

$ sudo ./configure --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apache2/bin/apr-1-config --with-apu=/usr/local/apahe2/bin/apu-1-config
...
configure: WARNING: APR util was not compiled with crypto support. SecRemoteRule will not support the parameter 'crypto'
...


APR util についての警告 (WARNING) が出ましたが configure 自体は問題なく終了したように見えたので make の実行に進みます。なお、後ほど Apache httpd をリビルドすることになりますが、その際にこの警告の解消も目指します。

$ sudo make


make も問題なく終了したので make install に進んで良いように思えましたが, なんとなく make test の実行を行いました。

$ sudo make test



At the time of `make test'




libaprutil-1.so: undefined reference to `XML_



make test では次のエラーと遭遇しました。

$ sudo make test
...
/usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_SetUserData'
/usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_ParserFree'
/usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_ParserCreate'
/usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_Parse'
/usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_GetErrorCode'
/usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_SetElementHandler'
/usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_SetCharacterDataHandler'
/usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_SetEntityDeclHandler'
/usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_ErrorString'
/usr/bin/ld: /usr/local/apache2/lib/libaprutil-1.so: undefined reference to `XML_StopParser'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:837: msc_test] Error 1
make[2]: Leaving directory '/usr/local/src/modsecurity-2.9.5/tests'
make[1]: *** [Makefile:1605: check-am] Error 2
make[1]: Leaving directory '/usr/local/src/modsecurity-2.9.5/tests'
make: *** [Makefile:501: check-recursive] Error 1


ネットの噂によれば, このような make test のエラーはそれほど気にしなくても良いそうですが, 良い経験になりそうなので解決を目指すことにしました。

当初は文字列 error に誘われてキーワード「 collect2: error: ld returned 1 exit status 」で解決策を探し回りましたが、結果的にキーワード「 libaprutil-1.so: undefined reference to `XML_ 」で解決策を探さなければならないことを理解しました。

するとこの原因が「XML 関連ライブラリが不足していて参照が無効になっている」ことにあるとわかりました。解決策は「 libxml2-dev をインストール後に apr-util を再インストールせよ」とのことです。

手元の環境では上述のとおり apr シリーズ (apr, apr-util, apr iconv) を httpd にバンドルしてビルドしてあるので、Apaceh htppd のリビルドを行う必要があると理解しました。

Apache httpd のリビルド以外に方法がないものか探し回り、そのいくつかを試しましたが上記エラーは解消できませんでした。このため, しぶしぶ Apache httpd をリビルドすることにしました。


Apache httpd のリビルド



実行中の httpd を停止。

$ sudo /usr/local/apache2/bin/apachectl stop


httpd のソースディレクトリに移動。

$ cd /usr/local/src/httpd-2.4.52


ソースディレクトリ内のファイル config.nice で前回の configure オプションを確認できます。

$ cat /usr/local/src/httpd-2.4.52/config.nice
#! /bin/sh
#
# Created by configure

"./configure" \
"--enable-mpms-shared=all" \
"--enable-mods-shared=all" \
"--enable-ssl" \
"--with-included-apr" \
"$@"


これをもとに ModSecurity の make test で発生した「 libaprutil-1.so: undefined reference to `XML_ ... collect2: error: ld returned 1 exit status ... 」のエラーの解消を目指します。


configure



Apache httpd のリビルドに際して, ModSecutiry 「 make test 」時の前述のエラーを解消するには、 apr-util に XML パーサー の C ライブラリ「 Expat 」の場所を知らせなければならないとのことでした。

Expat 関連のライブラリはここまでの手順においてインストールしてあります (libexpat1, libexpat1-dev)。

手元の環境では httpd ソースディレクトリ内 (srclib/) に apr シリーズをバンドルしてありますので、httpd と apr シリーズをまとめて configure することになります。

この場合で apr-util に configure の指示を行うには、 httpd へ指示を行う各オプションの前に apr-util 用のオプションを配置するとよいそうです。

apr-util に与えたい指示は次のオプションです。当該パスは libexpat.so が格納されたディレクトリへのシステムパスです。

--with-expat=/usr/lib/x86-64-linux-gnu


httpd を configure します。

$ sudo ./configure --with-expat=/usr/lib/x86-64-linux-gnu --enable-mpms-shared=all --enable-mods-shared=all --enable-ssl --with-included-apr


結果です。「 LDFLAGS 」に libexpat へのパスが指定されています。

configure: summary of build options:

Server Version: 2.4.52
Install prefix: /usr/local/apache2
C compiler: gcc
CFLAGS: -g -O2 -pthread
CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE
LDFLAGS: -L/usr/lib/x86-64-linux-gnu/lib
LIBS:
C preprocessor: gcc -E


これにより apr-util が XML をパースできるようにため、ModSecurity make test 時のエラー「 libaprutil-1.so: undefined reference to `XML_ ... 」を解消できるはずです。

加えてここで、ModSecurity make test 時の警告「 WARNING: APR util was not compiled with crypto support 」の解消も目指します。

apr-util に crypto サポートを行わせるためには、configure 時にオプション「 --with-crypto 」が必要とのことでした。また、--with-crypto だけでは httpd の make でエラーが発生するため、追加でオプション「 --with-openssl=/usr/lib/ssl 」も必要でした。--with-openssl へのパスはコマンド「 openssl version -d 」で確認したものです。

apr-util のための上記オプションを追加して httpd を configure します。するとどうでしょう、

$ sudo ./configure --with-openssl=/usr/lib/ssl --with-crypto --with-expat=/usr/lib/x86-64-linux-gnu --enable-mpms-shared=all --enable-mods-shared=all --enable-ssl --with-included-apr
...
configure: summary of build options:

Server Version: 2.4.52
Install prefix: /usr/local/apache2
C compiler: gcc
CFLAGS: -g -O2 -pthread
CPPFLAGS: -DLINUX -D_REENTRANT -D_GNU_SOURCE
LDFLAGS: -L/usr/lib/ssl/lib -L/usr/lib/x86-64-linux-gnu/lib
LIBS:
C preprocessor: gcc -E

「 LDFLAGS 」にさらなるシステムパスが設定されました。


make && make install



前項の configure 後に make と make install を実行し、httpd のリビルドについては問題なく完了したことを確認しました。

$ sudo make
$ sudo make install


なお、初回ビルド後に /usr/local/apache2/ 以下で編集した設定内容 (conf/httpd.conf や Virtual Host 用のディレクトリ等) はそのまま維持されます。


ModSecurity のリビルド



前回発生したエラーと警告が解消できているかを確認するために ModSecurity のリビルドを行います。

公式 https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-%28v2.x%29#unix によれば configure 時のオプションは「 --with-apxs=/PATH/TO/apxs 」のみでよさそうに見えますが、手元の環境では以下 2 つのオプションが必須でした。

--wtih-apr=/PATH/TO/apr-1-config
--wtih-apu=/PATH/TO/apu-1-config


modsecurity を configure します。

$ sudo ./configure --with-apxs=/usr/local/apache2/bin/apxs --with-apr=/usr/local/apache2/bin/apr-1-config --with-apu=/usr/local/apache2/bin/apu-1-config

問題は発生しませんでした。

make でも問題は発生しませんでした。

$ sudo make


課題の make test を実行します。

$ sudo make test
...
PASS: run-unit-tests.pl
============================================================================
Testsuite summary for modsecurity 2.9
============================================================================
# TOTAL: 1
# PASS: 1
# SKIP: 0
# XFAIL: 0
# FAIL: 0
# XPASS: 0
# ERROR: 0
============================================================================
make[3]: Leaving directory '/usr/local/src/modsecurity-2.9.5/tests'
make[2]: Leaving directory '/usr/local/src/modsecurity-2.9.5/tests'
make[1]: Leaving directory '/usr/local/src/modsecurity-2.9.5/tests'
make[1]: Entering directory '/usr/local/src/modsecurity-2.9.5'
make[1]: Nothing to be done for 'check-am'.
make[1]: Leaving directory '/usr/local/src/modsecurity-2.9.5'


PASS 」... 僕にはこの文字がとても眩しく見えました。

sudo make install...


NEXT



次回は、Mod Perl2 の「 Documentation / Tutorials 」を確認する前に、本文中で言及のあった More Tuning Advice "Stas Bekman's Performance Guide" のリンク先「 Documentation / 1.0 / mod_perl 1.0 User Guide / Performance Tuning 」を「 mod_perl 」公式サイト (https://perl.apache.org/index.html) より確認する予定です。


参考情報は書籍「 続・初めての Perl 改訂版 」, 「 Effective Perl 第 2 版 」を中心に perldoc, Wikipedia および各 Web サイト。それと詳しい先輩。

目次 - Perl Index
























同じカテゴリー(Perl)の記事
 Perl mp2 翻訳 Web コンテンツ圧縮の FAQ (d228) (2023-10-11 23:49)
 Perl mp2 翻訳 既知のブラウザのバグの回避策をいくつか (d227) (2023-05-26 15:41)
 Perl mp2 翻訳 Perl と Apache でのキュートなトリック (d226) (2023-05-19 17:05)
 Perl mp2 翻訳 テンプレートシステムの選択 (d225) (2022-08-15 22:23)
 Perl mp2 翻訳 大規模 E コマースサイトの構築 (d224) (2022-06-15 20:43)
 Perl mp2 翻訳 チュートリアル (d223) (2022-06-15 20:42)
上の画像に書かれている文字を入力して下さい
 
<ご注意>
書き込まれた内容は公開され、ブログの持ち主だけが削除できます。

Llama
リャマ
TI-DA
てぃーだブログ
プロフィール
セラ (perlackline)
セラ (perlackline)
QRコード
QRCODE
オーナーへメッセージ

PAGE TOP ▲