nginx + ModSecurityでcore dump

表題の通り core dump を起こしていた。

■ 環境

  • ModSecurity 2.9.2
  • nginx 1.12.1
  • CentOS 6.9

■ error.log

下記のようなエラーログが出力された。

2017/11/09 19:03:34 [alert] 47480#47480: worker process 47482 exited on signal 11 (core dumped)

最近この環境を作り直した時に気がついたのだが、ModSecurityの公式のページに下記のような記載が増えていた。

NOTE: Some instabilities in the Nginx add-on have been reported (see the Github issues page for details). Please use the "nginx_refactoring" branch where possible for the most up to date version and stay tuned for the ModSecurity version 4.

とのことなので、”nginx_refactoring“を試してみることにした。

■ nginx_refactoring

GitHubからzipでダウンロードし展開したところ、”configure“がない。`autogen.sh`があるので実行してみた。

$ ./autogen.sh
./autogen.sh: line 11: libtoolize: コマンドが見つかりません
./autogen.sh: line 12: autoreconf: コマンドが見つかりません
./autogen.sh: line 13: autoheader: コマンドが見つかりません
./autogen.sh: line 14: automake: コマンドが見つかりません
./autogen.sh: line 15: autoconf: コマンドが見つかりません
$

これらのパッケージをインストールする。対象パッケージは下記の通り。

$ sudo yum install libtool automake autoconf

再度`autogen.sh`を実行したところ問題なく”configure“が生成された。後は通常通り。

$ ./configure --enable-standalone-module --disable-mlogc
$make

nginxもリコンパイルしてインストールしなおしたところ、前回と同様のアクセスをしたがcoreは吐かれなくなった。とりあえずその場しのぎではあるのだが解決としておく。

以上。

■ 関連

nginx + ModSecurity