Installing ModSecurity 2.x
# yum install libxml2 libxml2-devel httpd-devel pcre-devel
# wget http://www.modsecurity.org/download/modsecurity-apache_2.5.11.tar.gz
# tar -xzvf modsec*
# cd modsecurity-apache_2.5.11/apache2/
ModSecurity installation consists of the following steps:
ModSecurity 2.x works with Apache 2.0.x or better.
Make sure you have mod_unique_id installed.
(Optional) Install the latest version of libxml2, if it isn't already installed on the server.
Unpack the ModSecurity archive
Edit Makefile to configure the path to the Apache ServerRoot directory. You can check this by identifying the ServerRoot directive setting in your httpd.conf file. This is the path that was specified with the "--install-path=" configuration flag during compilation (for example, in Fedora Core4: top_dir = /etc/httpd).
(Optional) Edit Makefile to enable ModSecurity to use libxml2 (uncomment line DEFS = -DWITH_LIBXML2) and configure the include path (for example: INCLUDES=-I/usr/include/libxml2)
# ./configure
# make
# service httpd stop
# make install
# vi /etc/httpd/conf/httpd.conf
Add one line to your configuration to load ModSecurity: LoadModule security2_module modules/mod_security2.so
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule security2_module modules/mod_security2.so
(Optional) Add one line to your configuration to load libxml2: LoadFile /usr/lib/libxml2.so
Add one line to your configuration to load ModSecurity: LoadModule security2_module modules/mod_security2.so
Configure ModSecurity
# service httpd start
You now have ModSecurity 2.x up and running.