Logging setup in Apache

Previous  Next

Apache Web Server

Deep Log Analyzer supports CLF log files created by Apache web server. If you use DeepTracker method for session tracking, you need to enable Cookie field in Apache logs. Follow these instructions to change logs format in Apache web server:

1.Open APACHE_HOME/conf/http.conf file (APACHE_HOME represents the Apache install directory) on the webs server computer in a text editor of your choice. Normally it should have the line similar to the one below. Find it:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

2.Copy it to the line below and add {Cookie} field at the end. Assign this format specification a different name:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\"" combined_cookies

3.Then modify CustomLog like line to use newly specified log format:

CustomLog logs_path/access.log combined_cookies

4.Save modified http.conf file
5.Verify http.conf syntax

For Unix/Linux based systems

APACHE_HOME/bin/apachectl configtest

For Windows

APACHE_HOME/bin/apache -t

This should pass without any errors.

6.Restart Apache web server. Run this command from command prompt

For Unix/Linux based systems

APACHE_HOME/bin/apachectl restart

For Windows. Open Services in Control  Panel and Restart Apache service or issue following commands:

net stop apache2
net start apache2

7.Check log file format. Open web browser, visit the website and make a few clicks. Open logs_path/access.log file. Look at a few last lines of the log file. They should contain DeepTracker cookie at the end like in this sample:

192.168.1.101 - - [18/Dec/2006:11:51:31 -0800] "GET /buglist.html HTTP/1.1" 200 5485 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0" "__dla_cc=84353-2109416784;__dla_sc=_dt_ss_uid%3D65650-51180020%26_dtscr%3D1680x1050x32%26_dtlang%3Den-US%26_dtjava%3Dtrue%26_dtflash%3D9.0%20%20r28"

Notice presence of __dla_cc and __dla_sc cookies created by DeepTracker

Supported formats of Apache log

Deep Log Analyzer supports following formats of Apache log files.

Common log format (CLF) without referrers, user agent, and cookies. Referrals, search engines, browsers, OSs, etc. reports will be empty.

LogFormat "%h %l %u %t \"%r\" %>s %b" common

Combined log format:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined

Combined log format with cookie field. Recommended format that allows to use DeepTracker technology and allows to create a full set of reports

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\"" combined_cookies

Deep Log Analyzer also supports virtual host field (%v) in log files. It's used when you run a server with many virtual hosts, that use the same log file. Virtual host field should always be first:

LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\"" combined_cookies

Copyright © 2004-2017 Deep Software Inc. All rights reserved.
www.deep-software.com