cPanel: How to disable mod_security2 for account or path

To disable mod_security2 from cPanel server,

1. Create the following folder.


2. Create a file name disabled_modsec2.conf in the above path.
3. Enter the following line if you want to disable mod_security2 for whole domain.

<IfModule mod_security2.c>
SecRuleEngine Off

For specific path,

<LocationMatch your_path>
<IfModule mod_security2.c>
SecRuleEngine Off

4. Run the following script from root access.

/scripts/ensure_vhost_includes –user=username

Edit the following file,


Enter the information below,

SecRule SERVER_NAME "" phase:1,nolog,allow,ctl:ruleEngine=off

Replace the will do.

Published by

Mick Genie

Mick Genie is the founder of and working at ExaBytes Network Sdn Bhd and WPWebHost web host company. He is expertise in Windows and Linux environment especially web hosting related information, tips and trick as well as the IT Information.