Page 1 of 1

How to disable mod_security for a domain

Posted: Fri Jul 13, 2012 2:16 pm
by gautham
How to disable mod_security for a domain in cpanel servers.
vi /usr/local/apache/conf/modsec2.user.conf
On top of that file insert the below rule
SecRule SERVER_NAME "domain.com" phase:1,nolog,allow,ctl:ruleEngine=off

Re: How to disable mod_security for a domain

Posted: Tue Jul 31, 2012 11:00 am
by a24uall
Another method is to add the below code under the domains virtual host entry in httpd.conf
vi /usr/local/apache/conf/httpd.conf
<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>
Example of a httpd conf in which the above code is added
<VirtualHost 73.25.35.159:80>
ServerName domain.com
ServerAlias http://www.domain.com
DocumentRoot /home/user/public_html
ServerAdmin [email protected]
## User arun # Needed for Cpanel::ApacheConf
<IfModule mod_security2.c>
SecRuleEngine Off
</IfModule>