using PHP (and some ShellScript) to protect your linux server against bruke force attacks(http://en.wikipedia.org/wiki/Brute_force_attack).
also keep a log in MySQL and have email reporting
Web App Firewall - its full service PHP software for stop attacks agai
WAFs goal is protect sites against hackers and virus attacks. Web App Firewall its PHP application that implement principle of reverse-proxy , build and control traffic map and comfortable management interface.