Hi, I have Cpanel/WHM. I have enabled modsecurity on my whm server. After enabling it I have started getting 404 not found error in some of the operations of my admin area. How can I resolve it ?
I assume you have some knowledge of Linux server/cPanel, you will need to check mod_security logs and check the rules that your script get caught with and disabled or rearrange mod_security rules accordingly. Usually /etc/apache2/logs/modsec_audit.log Do you use your own rules or using waf or another free modsec rules?
Try using the OWASP ruleset instead, it's usually a lot less problematic. Also try tail -f /usr/local/apache/logs/error_log and replicate the issue at the same time. It should shed some light on the issue. But the issue is most likely caused by a rule you have that is breaking your front end, 404's are usually the end result of a 5xx error. So check the error using the above method and then find the rule causing it in /etc/httpd/conf/modsec2.conf
First, it is better to check the ModSecurity rules via ConfigServer ModSecControl inside the WHM. If you don't find the abnormal configuration, check the ModSecurity logs. /usr/local/apache/logs/modsec_audit.log If you send the logs here, we can advise better. Most probably, you have a permission problem in the directories.