How To Install Mod_Security Apache on CentOS 6


For those of you who didn’t know, Mod_security is an Apache module that helps to protect your website from various attacks such as cross-site scripting, SQL injection attacks, path traversal attacks etc. Mod_evasive is an Apache module that helps to prevent HTTP DoS (DDoS) attacks or server brute force attacks. It operates embedded into the web server, acting as a powerful umbrella, shielding applications from attacks.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation mod_security apache on centos 6.

Step 1. Installing Dependencies for mod_security.

Step 2. Download latest stable release of mod_security source code from their official website to your server.

Step 3. Configuring Mod_Security.

Now set the basic rule set in your httpd.conf file. Add the following lines of code at the end of the file:

Save the changes and restart Apache:

Step 4. Download and configure OWASP (Open Web Application Security Project) core rule set for a base configuration.

Open the Apache configuration file again, and add the following lines at the end of the file:

Next, restart the Apache service to enable mod_security module:

Congratulation’s! You have successfully installed mod_security apache. Thanks for using this tutorial for installting mod_security apache web server on centos 6 systems.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!