I need to find where Apache is keeping the access and error logs for a site.

I have root access to a server where dozens of sites are hosted. I'm trying to debug one of those sites. When I browse the site, it doesn't show up on /var/logs/apache2/access.log or /var/logs/apache2/error.log. (The files are there, and other sites gets logged on those. In fact, there are hundreds of different log files).

Neither locate httpd.log nor find . -iname httpd.log performed at / issue any results.

The apache configuration for the site is:

ServerName REDACTED.com.br
DocumentRoot /var/www/xyz/wiki
AssignUserId xyz_wiki xyz_wiki

<Directory /var/www/xyz/wiki/data>
order allow,deny
deny from all
<Directory /var/www/xyz/wiki/conf>
order allow,deny
deny from all
<Directory /var/www/xyz/wiki/bin>
order allow,deny
deny from all
<Directory /var/www/xyz/wiki/inc>
order allow,deny
deny from all

php_admin_value open_basedir /var/www/xyz/wiki/:/mnt/vdImagem/www/xyz/wiki/
  • 7
    This is not a dupe, the OP has linked to the proposed duplicate in the question itself and clearly states that the info is not in /var/log/apache2/access.log which is what the duplicate suggests.
    – terdon
    Commented Feb 19, 2014 at 19:38
  • Try sudo lsof -nP -c apache2 -c httpd | grep -i log Commented Feb 19, 2014 at 21:58

4 Answers 4


You can inquire about his information from Apache's log files but it's generally better to inquire about these things from the actual executable. Parsing the logs can be tricky and you'll likely make a mistake if you aren't that familiar with how a particular setup was done on a box.

httpd -V

$ httpd -V
Server version: Apache/2.2.15 (Unix)
Server built:   Feb 13 2012 22:31:42
Server's Module Magic Number: 20051115:24
Server loaded:  APR 1.3.9, APR-Util 1.3.9
Compiled using: APR 1.3.9, APR-Util 1.3.9
Architecture:   64-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D HTTPD_ROOT="/etc/httpd"
 -D SUEXEC_BIN="/usr/sbin/suexec"
 -D DEFAULT_PIDLOG="run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="logs/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="conf/mime.types"
 -D SERVER_CONFIG_FILE="conf/httpd.conf"

The key items you want to look at are as follows.

  1. This tells you the "root" directory that all the files Apache will reference start from:

     -D HTTPD_ROOT="/etc/httpd"
  2. config files are defined, starting here. Note that this path is relative to the path mentioned in #1, so it would be /etc/httpd/conf/httpd.conf.

     -D SERVER_CONFIG_FILE="conf/httpd.conf"
  3. Error log is here.

     -D DEFAULT_ERRORLOG="logs/error_log"

    NOTE: This one might be a bit confusing at first but on Red Hat distros there is a link that is often made in this directory, /etc/httpd called logs.

    $ ls -ld /etc/httpd/logs
    lrwxrwxrwx. 1 root root 19 Jul  9  2012 /etc/httpd/logs -> ../../var/log/httpd
  4. Other log files that might be utilized by Apache will be defined further in the config file, /etc/httpd/conf/httpd.conf.

  • 1
    httpd -V command doesn't work on Debian 9.
    – Christia
    Commented Jun 18, 2018 at 17:58
  • 2
    Try apache2 -V
    – Draex_
    Commented Feb 25, 2020 at 22:35
  • 1
    I belive you should use apachectl -V
    – undefined
    Commented Mar 26, 2021 at 8:58

I couldn't get any of the command from the other answers to find my value. I ended up finding what i needed by running less /etc/apache2/envvars

  • 2
    Thank-you for this; for me a slight tweak to yours gave me what I needed; cat /etc/apache2/envvars | grep LOG. This showed $SUFFIX on the path. Per serverfault.com/a/558295/137255 that value's typically blank, unless you have multiple instances of apache on the same host.
    – JohnLBevan
    Commented Dec 2, 2021 at 12:03

Look in your apache config for the string ErrorLog.

Usually there's one for the Apache process itself. Each VirtualHost can also define its own log files so check those as well.

If the VirtualHost doesn't define its own log file then it will be using the one specified in the global configuration. If you think you've found the correct log file but you aren't seeing the information you need then try increasing the LogLevel.

  • 1
    /etc/apache2# rgrep "ErrorLog" . displays dozens of config files that specify ${APACHE_LOG_DIR}/error.sitename.log, but this is not one of those. /etc/apache2# rgrep "LogLevel" . gets me only a few default files. Commented Feb 19, 2014 at 20:13
  • 3
    On Debian ${APACHE_LOG_DIR} is defined as /var/log/apache2 by default. Check /etc/defaults/apache2 to see if it has been changed.
    – bahamat
    Commented Feb 19, 2014 at 22:34
  • If there's no LogLevel set for a particular VirtualHost you can add one.
    – bahamat
    Commented Feb 19, 2014 at 22:35

I just found a file /etc/apache2/conf.d/other-vhosts-access-log which contains

# Define an access log for VirtualHosts that don't define their own logfile
CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined

Looks like it is a way to combine all logs from vhosts in a single file. I have checked and the accesses were being recorded there.


Inserting an ErrorLog and an AccessLog directive on the config file for that site provided me separate log files.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .