POR: Daniel Vazart
URL: http://www.vazart.net
root@dvazart-laptop:# apt-get install apache2-dev libxml++2.6-dev
root@dvazart-laptop:# apt-get install liblua5.1-0 liblua5.1-socket-dev liblua5.1-socket2
root@dvazart-laptop:# updatedb
root@dvazart-laptop:# locate libxml2.so
/usr/lib/libxml2.so
root@dvazart-laptop:# locate liblua5.1.so
/usr/lib/liblua5.1.so.0
root@dvazart-laptop:# /etc/init.d/apache2 stop
root@dvazart-laptop:# wget http://www.modsecurity.org/download/modsecurity-apache_2.5.0.tar.gz
root@dvazart-laptop:# gunzip modsecurity-apache_2.5.0.tar.gz
root@dvazart-laptop:# tar -xvpf modsecurity-apache_2.5.0.tar
root@dvazart-laptop:# cd modsecurity-apache_2.5.0
root@dvazart-laptop:# cd apache2/
root@dvazart-laptop:# ./configure
root@dvazart-laptop:# make
root@dvazart-laptop:# make install
root@dvazart-laptop:# chmod 644 /usr/lib/apache2/modules/mod_security2.so
root@dvazart-laptop:# nano /etc/apache2/mods-available/mod-security2.load
Y agregamos estas lineas:
LoadFile /usr/lib/libxml2.so
LoadFile /usr/lib/liblua5.1.so.0
LoadModule security2_module /usr/lib/apache2/modules/mod_security2.so
root@dvazart-laptop:# nano /etc/apache2/mods-available/mod-security2.conf
Y agregamos estas lineas:
< ifmodule mod_security2.c >
Include /etc/modsecurity/*.conf
< /ifmodule >
root@dvazart-laptop:# mkdir /etc/modsecurity/
root@dvazart-laptop:# cd /etc/modsecurity/
root@dvazart-laptop:# wget http://www.modsecurity.org/download/modsecurity-core-rules_2.5-1.6.0.tar.gz
root@dvazart-laptop:# gunzip modsecurity-core-rules_2.5-1.6.0.tar.gz
root@dvazart-laptop:# tar -xvpf modsecurity-core-rules_2.5-1.6.0.tar
root@dvazart-laptop:# rm modsecurity-core-rules_2.5-1.6.0.tar
root@dvazart-laptop:# nano modsecurity_crs_10_config.conf
(linea: 191)SecAuditLog logs/modsec_audit.log
por SecAuditLog /var/log/apache2/modsec_audit.log
(linea: 285)SecDebugLog logs/modsec_debug.log
por SecDebugLog /var/log/apache2/modsec_debug.log
root@dvazart-laptop:# a2enmod unique_id (requerido por mod-security)
root@dvazart-laptop:# a2enmod mod-security2
root@dvazart-laptop:# /etc/init.d/apache2 force-reload
root@dvazart-laptop:# /etc/init.d/apache2 start