Hi all,
 
I’m currently in the process of setting up an Apache 2.2.26 on AIX 7.1 and want to include mod_security.
 
I managed to compile Apache from source by running the following configure command:
 
./configure --prefix /opt/freeware/apache-dev --enable-so --enable-authn-file=shared --enable-authn-default=shared --enable-authz-host=shared --enable-authz-groupfile=shared --enable-authz-user=shared --enable-authz-dbm=shared --enable-authz-owner=shared --enable-auth-basic=shared --enable-dbd=shared --enable-dumpio=shared --enable-include=shared --enable-filter=shared --enable-deflate=shared --with-z=/opt/freeware/zlib-for-apache --enable-log-config=shared --enable-log-forensic=shared --enable-logio=shared --enable-env=shared --enable-headers=shared --enable-ident=shared --enable-setenvif=shared --enable-version=shared --enable-proxy-ajp=shared --enable-balancer=shared --enable-mime=shared --enable-dav=shared --enable-status=shared --enable-autoindex=shared --enable-asis=shared --enable-info=shared --enable-cgi=shared --enable-dav-fs=shared --enable-negotiation=shared --enable-dir=shared --enable-imagemap=shared --enable-actions=shared --enable-userdir=shared --enable-alias=shared --enable-rewrite=shared --enable-wl-22=shared --enable-jk=shared  --enable-unique-id=shared --enable-proxy=shared --with-pcre
 
This worked fine, so next thing I tried was to compile mod_security.
For this I used the following commands:
 
wget http://www.modsecurity.org/tarball/2.7.7/modsecurity-apache_2.7.7.tar.gz
 
gzip -cd modsecurity-apache_2.7.7.tar.gz | tar -xf –
 
./configure --with-apxs=/opt/freeware/apache-dev/bin --enable-verbose-output --with-pcre=/media/IBM_INSTALL_REPOSITORY/AIX/APACHE/httpd-2.2.26/srclib/pcre --with-apr=/opt/freeware/apache-dev/bin --with-apu=/opt/freeware/apache-dev/bin
 
mkdir /media/IBM_INSTALL_REPOSITORY/AIX/APACHE/ModSecurity/modsecurity-apache_2.7.7/apache2/libxml
 
cp /opt/freeware/include/libxml2/libxml/*.h /media/IBM_INSTALL_REPOSITORY/AIX/APACHE/ModSecurity/modsecurity-apache_2.7.7/apache2/libxml
 
This worked fine as far as I could see, so I ran the make test command which returned the following output:
 
PASS: run-unit-tests.pl
Target "all" is up to date.
============================================================================
Testsuite summary for modsecurity 2.7
============================================================================
# TOTAL: 1
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
Target "check" is up to date.
Target "check-am" is up to date.
Target "test" is up to date.
 
But when I run make install I get the following:
 
libtool: install: ../build/install-sh -c .libs/mod_security2.a /usr/local/modsecurity/lib/mod_security2.a
libtool: install: ../build/install-sh -c .libs/mod_security2.lai /usr/local/modsecurity/lib/mod_security2.la
        make  install-exec-hook
Removing unused static libraries...
Usage: cp [-fhipHILPU][-d|-e] [-r|-R] [-E{force|ignore|warn}] [--] src target
   or: cp [-fhipHILPU] [-d|-e] [-r|-R] [-E{force|ignore|warn}] [--] src1 ... srcN directory
make: The error code from the last command is 1.
 
Stop.
make: The error code from the last command is 2.
 
Stop.
make: The error code from the last command is 2.
 
Stop.
make: The error code from the last command is 1.
 
Stop.
 
When I copy the mod_security2.so file from modsecurity-apache_2.7.7/apache2/.libs to the Apache modules directory and change the Apache config to load the new module I’m not able to start/stop/restart Apache anymore because of a core dump.
 
Did I use the correct procedure?
Is mod_security 2.7.7 and Apache 2.2.26 even compatible or do I need different versions for this to work?
 
Thanks in advance,
Jürgen