I have CentOS, and I compiled it a month or two ago, so you may have to tweak this.
mod_security2.5 is the new version http://www.modsecurity.org/.
You need liblua readline-dev and ncurses dev as well as libxml2.
aptget install readline-dev ncurses-dev libxml2 libxml2-dev
I had to make Lua from source because CentOS doesn't have it in the default repos:
tar -xvf lua-5.1.tar.gz
make linux && make install
gcc -shared -o /usr/local/lib/liblua.5.1.3.so /usr/local/lib/liblua.a # Compile liblua library into a Shared Object for Apache to use
tar -xvf modsecurity-apache_2.5.12
make && make install
cp modsecurity.conf-minimal /etc/httpd/modsecurity.d/mod_security_minimal.conf # Copy the minimal rule set to our configuration
You will need to modify your Apache config to load liblua and libxml2. Notice this is LoadFile not Load Module. /etc/httpd/conf/httpd.conf
And you probably want to keep your rules organized:
For further configuration add your own ruleset in the modsecurity.d directory, and you can also copy any default rulesets you want from the mod_security folder extracted above under the
Restarting httpd will be required.