Where are Apache Access and Error Logs Stored?

Locating the default access and error logs for the Apache HTTP Server is a crucial first step for troubleshooting website errors, tracking visitor traffic, and monitoring server security. Depending on your operating system—whether it is a Linux distribution like Ubuntu, Debian, CentOS, or RHEL, or a Windows environment—Apache stores these critical log files in different default directories. This guide provides a quick reference to help you find these logs instantly across various platforms, along with the commands needed to view them.

Default Log Locations by Operating System

Because Apache is packaged differently across Linux distributions and operating systems, the file paths to the access.log and error.log will vary.

Operating System / Distribution Log Directory Path
Ubuntu / Debian (Apache2) /var/log/apache2/
CentOS / RHEL / Fedora (httpd) /var/log/httpd/
macOS (Built-in Apache) /var/log/apache2/
Windows (Default XAMPP Installation) C:\xampp\apache\logs\

In most Linux setups, the files are specifically named access.log for visitor traffic and error.log for system diagnostics and PHP errors. On Red Hat-based systems (CentOS/RHEL), they are often named access_log and error_log.

How to Find Custom Log Paths

If your server hosts multiple websites using Virtual Hosts, the logs might be saved in custom directories instead of the default paths listed above. You can find the exact location by checking the Apache configuration files.

Open the relevant configuration file and look for the following two directives:

ErrorLog /path/to/custom/error.log CustomLog /path/to/custom/access.log combined

Useful Commands to View Apache Logs

If you are using a Linux server via SSH, you can use standard terminal commands to view and monitor your logs in real-time.