Last Updated: February 25, 2016
·
1.125K
· lumoz

cPanel VPS: disable mod_security for an account

Connect in SSH with your root account in your VPS. Open this file:

/usr/local/apache/conf/userdata/std/2/{account}/{domain}/modsec.conf

where {account} is domain owner account and {domain} is the domain name. If folders {account} and {domain} not exist, you must create them.

Add in modsec.conf file this lines:

<IfModule mod_security2.c>
  SecRuleEngine Off
</IfModule>

Save and exit. Now make sure to uncomment the line

# Include "/usr/local/apache/conf/userdata/std/2/{account}/{domain}/*.conf"

in /usr/local/apache/conf/httpd.conf file. Variables {account} and {domain} have the same meaning as above.

Finished, just restart apache:

/etc/init.d/httpd restart

And you done.