Before we configure the logging capabilities, we need to know where Apache's configuration file lives. To find out, we will query Apache itself with the following command line: httpd -V
as well as where the access log file for Apache is stored: DEFAULT_XFERLOG="/var/log/httpd/access_log"
The Apache configuration file is rather long, but also well documented. We are looking for something called "LogFormat", which specifies the format of the access log file. To search for "LogFormat", press the control and "V" keys as indicated in the two rows of command promts at the bottom. You should see some lines similar to: LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent
Next, we do a search for "CustomLog" which specifies the location to which the log file will be written. You should see a line similar to: CustomLog "/var/log/httpd/access_log" common
© 2000-2024Ulf-Dietrich Reips, Thomas Blumer, John Caffier, Christoph Neuhaus, & Jan Simson.All rights reserved.