Skip to content

Viewing the Apache access log and error log

Apache maintains two primary log files: the access log and the error log. On ruachost.com, these logs help administrators monitor traffic, troubleshoot issues, and maintain server security.

  • Diagnose website errors and performance issues.
  • Monitor visitor activity and requests.
  • Detect suspicious or unauthorized access attempts.
  • Verify server responses and application behavior.

The access log records every request made to your server. It includes:

  • Visitor IP address.
  • Requested URL.
  • HTTP response code (e.g., 200, 404, 500).
  • Browser and operating system details.
  • Managed Dedicated/VPS Accounts (cPanel): Access raw Apache access logs directly in cPanel → Metrics → Raw Access Logs.

  • Terminal window
    sudo tail -100 /etc/httpd/logs/access_log

    On Debian/Ubuntu systems:

    Terminal window
    sudo tail -100 /var/log/apache2/access.log
  • To search for specific requests (e.g., GET requests):

    Terminal window
    sudo tail -100 /var/log/apache2/access.log

The error log records warnings, errors, and anomalies encountered by Apache. Examples include:

  • Missing files (404 errors).
  • Permission issues.
  • Misconfigured directives.
  • Application errors.
  • Managed Dedicated/VPS Accounts (cPanel): Access raw Apache error logs in cPanel → Metrics → Errors.

  • Terminal window
    sudo tail -100 /etc/httpd/logs/error_log

    On Debian/Ubuntu systems:

    Terminal window
    sudo tail -100 /var/log/apache2/error.log
  • To search for specific errors (e.g., invalid requests):

    Terminal window
    sudo grep -i invalid /etc/httpd/logs/error_log