Kroko Just another WordPress weblog

April 21, 2014

Cpanel Disable mod_security2 for a single domain

Filed under: Cpanel — admin @ 10:10 pm

Mod_security is an open source Apache module.

This can be considered as firewall for web applications. It secures the system from the attackers.

The following steps can be used to disable mod_security2 rule for one domain in cPanel servers.

1. Make the directory “/usr/local/apache/conf/userdata/std/2/username/domain.com

2. Create a file “vhost.conf” in the above location

3. Add the following lines :

———-

<IfModule mod_security2.c>

SecRuleEngine Off

</IfModule>

———-

To disable mod_security2 for a particular location :

———

<LocationMatch specify_the_path_here>

<IfModule mod_security2.c>

SecRuleEngine Off

</IfModule>

</LocationMatch>

———

To disable a particular mod_security2 rule :

———

<IfModule mod_security2.c>

SecRuleRemoveById give_ruleID_here

</IfModule>

———

Run the following script after making the changes.

———

/scripts/ensure_vhost_includes --user=username

———

This script will uncomment the following line in apache configuration and restart apache.

———–

Include “/usr/local/apache/conf/userdata/std/2/username/domain.com/*.conf”

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress