ModSecurity installation requirements:
1) ModSecurity 2.x works only with Apache 2.0.x or higher. Version 2.2.x is highly recommended.
2.Make sure you have mod_unique_id installed.
mod_unique_id is packaged with Apache httpd.
3.libapr and libapr-util
This library is optional and only needed if you will be using the new Lua engine.
Note that ModSecurity requires the dynamic libraries. These are not built by default in the source distribution, so the binary distribution is recommended.
libcurl v7.15.1 or higher
If you will be using the ModSecurity Log Collector (mlogc) to send audit logs to a central repository, then you will also need the curl library.
Many have had issues with libcurl linked with the GnuTLS library for SSL/TLS support. It is recommended that the openssl library be used for SSL/TLS support in libcurl.
ModSecurity installation consists of the following steps:
Stop Apache httpd
Unpack the ModSecurity archive
Building differs for UNIX (or UNIX-like) operating systems and Windows.
Run the configure script to generate a Makefile. Typically no options are needed.
Options are available for more customization (use ./configure –help for a full list), but typically you will only need to specify the location of the apxs command installed by Apache httpd with the –with-apxs option.
There are certain configure options that are meant for debugging an other development use. If enabled, these options can substantially impact performance. These options include all –debug-* options as well as the –enable-performance-measurements options.
Compile with: make
Optionally test with: make test
This is step is still a bit experimental. If you have problems, please send the full output and error from the build to the support list. Most common issues are related to not finding the required headers and/or libraries.
Optionally build the ModSecurity Log Collector with: make mlogc
Optionally install mlogc: Review the INSTALL file included in the apache2/mlogc-src directory in the distribution.
Install the ModSecurity module with: make install
Windows (MS VC++ 8)
Edit Makefile.win to configure the Apache base and library paths.
Compile with: nmake -f Makefile.win
Install the ModSecurity module with: nmake -f Makefile.win install
Copy the libxml2.dll and lua5.1.dll to the Apache bin directory. Alternatively you can follow the step below for using LoadFile to load these libraries.
Edit the main Apache httpd config file (usually httpd.conf)
On UNIX (and Windows if you did not copy the DLLs as stated above) you must load libxml2 and lua5.1 before ModSecurity with something like this:
Load the ModSecurity module with:
LoadModule security2_module modules/mod_security2.so
Start Apache httpd
You should now have ModSecurity 2.x up and running.