Question
Answer
In order to proceed, you should have the Rule ID and the URI that is triggering the ModSecurity rule. If you do not have them, you can find them in the Apache logs:
How do I check which ModSecurity rules are being triggered?
Once you have the required information, you can update the whitelist.
- Log in to the server via SSH or WHM's Terminal as the
rootuser -
Edit the file
/etc/apache2/conf.d/whitelist.confwith your preferred text editor. If the file does not already exist, you can create it:# touch /etc/apache2/conf.d/whitelist.conf
-
Add the exclusion to the file. This is where you will place the path to be excluded and the rule ID:
CONFIG_TEXT: <LocationMatch "/path/index.php">
SecRuleRemoveById 20002221
</LocationMatch> -
Ensure the whitelist is correctly configured:
# apachectl -t
-
If the check returns "OK," you can restart Apache:
# /scripts/restartsrv_httpd
Comments
0 comments
Article is closed for comments.