Apache’s error log on cPanel is the first stop for almost every web problem and yet it is the log most operators least know how to read in detail. Lines mix together messages from the server itself, from mod_security, from PHP, from the SuExec layer, and from rotating shutdown notices. Knowing which line types are real signal and which are noise is the difference between five-minute and five-hour diagnosis.
What’s happening
The cPanel-default location for the global error log is /usr/local/apache/logs/error_log. Per-domain error logs land in /home/<user>/logs/<domain>.error.log if cPanel’s “Per-Domain Error Logs” feature is on. Each line has a timestamp, severity ([error], [warn], [notice], [info], [debug]), client IP if applicable, and the message. The message format varies wildly depending on which module emitted it.
How to verify
The common useful greps:
# real-time tail with severity filter
tail -f /usr/local/apache/logs/error_log | grep -E "\[error\]|\[warn\]"
# PHP fatals and warnings
tail -200 /usr/local/apache/logs/error_log | grep -iE "PHP Fatal|PHP Warning"
# mod_security blocks
tail -200 /usr/local/apache/logs/error_log | grep "ModSecurity"
# SuExec failures
tail -200 /usr/local/apache/logs/error_log | grep "suexec"
# per-domain log
tail -100 /home/<user>/logs/<domain>.error.log
For severity selection at the global level: grep -iv "notice\|info\|debug" cuts the noise.
The fix
- Recognize the noisy lines —
[notice] [pid X] AH00094: Command line:,Init: SSL,AH02282: No matching protocol found, and graceful-restart messages are normal. Filter them out withgrep -v. - Real signal patterns —
PHP Fatal error(application bug),client denied by server configuration(mod_security or directory deny),End of script output before headers(PHP crashed or returned non-HTTP),Premature end of script headers(similar),request failed: error reading the headers(client cut the connection mid-request). - Match timestamps to user reports — when a user says “the site was down at 14:23”, grep
error_logfor14:23and read everything within 30 seconds either side. A 500 in the error log without a 500 in the access log is a same-second correlation problem. - mod_security messages —
Access denied with code 403is intentional. The rule ID (e.g.,id "942100") tells you which OWASP CRS rule fired. Look it up before whitelisting. - Rotate carefully —
error_logis rotated bylogrotatedaily by default. After a rotation, the previous file iserror_log.1. If a problem started “this morning”, check both.
The per-domain logs are usually more useful than the global one because they isolate one application. Stack Harbor builds log-correlation alerts for cPanel hosts under cPanel/WHM management — start a conversation when error patterns are not obvious.