Apache Web server logging Notes - Oliver-Mustoe/Oliver-Mustoe-Tech-Journal GitHub Wiki
In this page I detail how I found and logged my Apache web server.
Notes
First I cleared my browser cache and ran my Apache url correctly once, then incorrectly (where I indicated it to go to a page on my webserver that does not exist.) Then in /etc/httpd/logs/access_log, using the command "sudo tail /etc/httpd/logs/access_log", I was able to see those log entries. Below is a screenshot of those log entries if I directed my Apache server to "doesnotexist.html", which does not exist. (NOTE: in the below screenshot I already navigated to /etc/httpd):
Using the above screenshot, below is a table below detailing what the description of the field is and what that reflects in a successful url:
Field description | My log - Successful url |
---|---|
IP Address (%h) | 10.0.5.150 |
RFC 1413 (%l) | - |
Userid of the person requesting (%u) | - |
Time that request was received (%t) | [28/Oct/2021 :10:52:54 -0400] |
Request line from the client (\“%r”) | “Get / HTTP/1.1” |
Status code that the server sends back to the client (%>s) | 200 |
Size of object returned to client (%b) | 276 |
HTTP request header ("%{Referer}i") | “-” |
User-Agent HTTP request header ("%{User-agent}i") | “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36” |
Using the above screenshot, below is a table below detailing what the description of the field is and what that reflects in a unsuccessful url:
Field description | My log - Unsuccessful url |
---|---|
IP Address (%h) | 10.0.5.150 |
RFC 1413 (%l) | - |
Userid of the person requesting (%u) | - |
Time that request was received (%t) | [28/Oct/2021 :10:53:04 -0400] |
Request line from the client (\“%r”) | “Get /doesnotexist.html HTTP/1.1” |
Status code that the server sends back to the client (%>s) | 404 |
Size of object returned to client (%b) | 215 |
HTTP request header ("%{Referer}i") | “-” |
User-Agent HTTP request header ("%{User-agent}i") | “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36” |