Mod Security is a web based firewall (WAF) designed for apache (though there is a version available for IIS too). It is widely used and highly effective. But there is a learning curve in using modsec. You can start exploring by installing ModSec on your system.
INSTALLATION USING YUM
To install modsec from YUM you will need to install EPEL ( Extra Packages for Enterprise Linux )
Depending upon your Linux installation run the following command
[yOMan@ x-machine ~]# uname -a
Linux x-machine.net.pk 2.6.18-308.1.1.el5 #1 SMP Wed Mar 7 04:57:35 EST 2012 x86_64