How to disable mod_security for a domain

Post Reply
gautham
Posts: 14
Joined: Sun Jul 01, 2012 10:32 am

How to disable mod_security for a domain

Post 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
Gautham G
WebhostingDevelopment.com
a24uall
Site Admin
Posts: 166
Joined: Sun Jul 01, 2012 9:07 am

Re: How to disable mod_security for a domain

Post 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>
Arun
WebhostingDevelopment.com
Post Reply

Return to “Mod_Security”