If the cPFence Web Application Firewall (WAF) is not functioning as expected, follow these 5 troubleshooting steps to diagnose and resolve the issue. These steps apply to servers running LiteSpeed, OpenLiteSpeed, Apache, or Nginx.
How to Tell If Your WAF Is Working
Before troubleshooting, you should confirm whether the WAF is active and enforcing rules. The easiest way is to use the built-in WAF testing tool. It simulates an attack and checks if it's blocked.
Visit this guide to learn how to use the test:
https://my.cpfence.app/knowledgebase/17/How-to-Use-the-cPFence-WAF-Testing-Tool-.html
1. Check Your Web Server Error Logs
Start by reviewing your web server’s error logs to identify any WAF-related issues:
- LiteSpeed/OpenLiteSpeed:
tail -n 50 /usr/local/lsws/logs/error.log
- Apache:
tail -n 50 /var/log/apache2/error.log
- Nginx:
tail -n 50 /var/log/nginx/error.log
These logs can help identify configuration issues, rule errors, or permission problems.
2. Restart the Web Server
Restart your web server to reload the WAF configuration:
- LiteSpeed/OpenLiteSpeed:
systemctl restart lshttpd.service
- Apache:
systemctl restart apache2.service
- Nginx:
systemctl restart nginx.service
3. Run the cPFence Cron Job
cPFence uses a scheduled cron job to keep rules and configurations updated. Running it manually may resolve your issue:
/opt/cpfence/app/cpfcron
Once complete, re-test the WAF to see if the issue is resolved.
4. Restart cPFence
If the WAF is still not working correctly, restart the cPFence engine:
cpfence --restart
5. Still Not Working?
If the issue persists after following the steps above, please contact our support team so we can investigate further.
Need Further Assistance?
If you encounter any issues or need additional help, feel free to reach out to our support team via your client portal.