Troubleshoot your website using error log in Cpanel

Linux Server Error Log:

The server error log, whose name and location is set by the error log directive, is the most important log file. This is the place where Apache httpd will send diagnostic information and record any errors that it encounters in processing requests. It is the first place to look when a problem occurs with starting the server or with the operation of the server, since it will often contain details of what went wrong and how to fix it.

Error log in CPanel/WHM:

The error log in cPanel shows HTTP errors that occur when visitors try to view your site. These errors may be related to requested files that were not found, permission settings, and so on. The error log in cPanel shows the last 300 entries from your web site's error log.

You can use this tool to detect suspicious activity, such as a possible virus infection or an unauthorized access attempt. 

How to see the error logs in CPanel:

  • Login into Cpanel and find the logs option where (Error Log) Icon Listed

Error Log in CPanel

                                                                                OR

  • Go to File Manager of CPanel and find the “error_log” file in public_html.

Format of Error Log:

The format of the error log is relatively free-form and descriptive. But there is certain information that is contained in most error log entries. For example, here is a typical message.

[Wed Oct 11 14:32:52 2000] [error] [client 127.0.0.1] client denied by server configuration: /export/home/live/ap/htdocs/test

1st Part: date and time of the message 

  • [Wed Oct 11 14:32:52 2000]

2nd Part: the severity of the error being reported

  • Client denied by server configuration: /export/home/live/ap/htdocs/test

3rd Part:  the IP address of the client that generated the error

  • client 127.0.0.1

During testing, it is often useful to continuously monitor the error log for any problems. On unix systems, you can accomplish this using:

"tail -f error_log"

Default error log file location:

  • RHEL / Red Hat / CentOS / Fedora Linux Apache error file location  “/var/log/httpd/error_log”
  • Debian / Ubuntu Linux Apache error log file location – “/var/log/apache2/error.log”

To find exact apache log file location, you can use grep command:
# grep ErrorLog /etc/apache2/apache2.conf
# grep ErrorLog /etc/httpd/conf/httpd.conf