Apache Log Files

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/apache-log-files/
PINTEREST
PINTEREST
INSTAGRAM

Apache or with real name httpd provides logs. These logs are very helpful while detecting errors, attacks. There is two type of Apache logs by default. Log resides in following directories.

Log Path

Apache logs are stored in different paths because of name difference for different distributions. DEB or apt family uses the name apache2 and stores logs as apache2 but  the RPM yum family uses the name httpd and stores logs in the httpd directory.

/var/log/httpd/

  • CentOS
  • Redhat
  • Fedora

/var/log/apache2/

  • Ubuntu
  • Debian
  • Kali

Getting Log Files Directory

Log file directory can be changed with Apache configuration. Look in to configuration file to exact log path

Ubuntu,Debian,Kali

CentOS,Fedora, Red Hat

Error Logs

Error logs are generally related with service and http request errors. For different distributions different paths exists but generally similar paths are used.

We can read error logs like below. We use less to read.

We can also search error file with grep

LEARN MORE  HTTP 403 Forbidden Status Code and Fix Error

Access Logs

Access logs generally provides http request related information and for busy site it will be generated a lot. Access log will provide following information about request or access attempts to our apache web server.

  • Client IP Address
  • Date and Time
  • Request URI
  • HTTP Status Code
  • Client Browser

Search For Specific HTTP Status Errors

We can search like error log with grep.In this example we will search for HTTP Status 404 errors in the access_log file.

LEARN MORE  What is Syslog Default Port and Secure Port and How to Configure It?

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/apache-log-files/
PINTEREST
PINTEREST
INSTAGRAM