How may I access the Apache Server Error Log?

Avatar
  • Answered
How may I access the Apache Server Error Log? Can I access it via cPanel or WHM? Or do I need putty or something like that?
Avatar
JacobIMH
Hello chankins, and thanks for your question. You can access the Apache error log at the following location on a VPS or dedicated server:
/usr/local/apache/logs/error_log
You would need to connect to the server via SSH using an SSH agent like PuTTY. I personally like PuTTYtray which offers a few more enhancements. Some good ways to navigate through the Apache error log would be watching it live:
tail -f /usr/local/apache/logs/error_log
Then you can hit Ctrl-C in PuTTY to stop watching the log. You could also specifically look for entries from your IP address. For instance if your IP was 123.123.123.123 you could use this:
grep "123.123.123.123" /usr/local/apache/logs/error_log | less
If you wanted to see the IP addresses that are causing the most Apache errors, you could run this:
awk '{print $8}' /usr/local/apache/logs/error_log | sort -n | uniq -c | sort -n
If you had any other questions at all, please let us know! - Jacob