disable/enable a modsecurity rule thru ssh

dalem

Well-Known Member
PartnerNOC
Oct 24, 2003
2,983
159
368
SLC
cPanel Access Level
DataCenter Provider
edit
/etc/apache2/conf.d/modsec/modsec2.user.conf

remove or comment out rule

then restart Apache
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello @niceboy,

I recommend using the following WHM API 1 functions if you want to edit or remove a rule via the command line:

WHM API 1 Functions - modsec_edit_rule - Developer Documentation - cPanel Documentation
WHM API 1 Functions - modsec_remove_rule - Developer Documentation - cPanel Documentation

Command line examples are available under the "Examples" section. You can review all Mod_Security WHM API 1 functions at:

WHM API 1 Sections - ModSecurity - Developer Documentation - cPanel Documentation

Thank you.