Header Ads

How to find Apache http server log files

Checking apache error log files can save you a lot of time and effort since it helps you pinpoint what the problem is. But the process isn't as easy as 123 especially for a newbie, here is how to find them. In my case i was using digital ocean.

Finding the exact apache log file location, just use grep command:

# grep ErrorLog /usr/local/etc/apache22/httpd.conf
# grep ErrorLog /etc/apache2/apache2.conf
# grep ErrorLog /etc/httpd/conf/httpd.conf
Sample output:
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a 
ErrorLog "/var/log/httpd-error.log"

Accessing the logs

Apache server records all incoming requests and all requests processed to a log file. The format of the access log is highly configurable. The location and content of the access log are controlled by the CustomLog directive. Default apache access log file location:
  • RHEL / Red Hat / CentOS / Fedora Linux Apache access file location - /var/log/httpd/access_log
  • Debian / Ubuntu Linux Apache access log file location - /var/log/apache2/access.log
  • FreeBSD Apache access log file location - /var/log/httpd-access.log
 find the exact apache error log location 

# grep CustomLog /usr/local/etc/apache22/httpd.conf
# grep CustomLog /etc/apache2/apache2.conf
# grep CustomLog /etc/httpd/conf/httpd.conf
Sample output:
  # a CustomLog directive (see below).
    #CustomLog "/var/log/httpd-access.log" common

    CustomLog "/var/log/httpd-access.log" combined

No comments:

Powered by Blogger.