Report Logging Server

Purpose

Reporting for is accomplished by placing one or more small 1x1 pixel images on site pages. These images (referred to as crumbs) transmit information about what pages are being viewed and what is being displayed on each page. These requests are logged by the Report Logging Server. This document details the information necessary to determine how to configure this server.

Setup

The report logging server is nothing more than an Apache server with mod_rewrite enabled, mod_headers enabled, mod_log_config enabled, a rewrite rule, some custom directives to prevent caching of reporting images and a special access log format. Sample configurations for the mod_rewrite module are given below. You may need to adapt these depending on the capabilities of regular expressions on your system.

Directive Configuration Discussion Where to place
LogFormat LogFormat "%h %{%d-%b-%Y %H %u}t %U %{Referer}i %q" atl This declares a new log format you can use when specifying where to log information. It logs IP_ADDRESS DATE-MONTH-YEAR HOUR_OF_DAY DAY_OF_WEEK REQUEST REFERER QUERY_STRING In your virthost directive or main server config
CustomLog /path/to/log/file/location atl This will create a log file using the log format necessary for the reporting server In your virthost directive or main server config
RewriteEngine on Enables the rewrite engine In your virthost directive or main server config
RewriteRule RewriteRule /images/mdwtc-[0-9]{3}\-([a-z}|_|[A-Z])*\-[0-9]*.gif$ /images/clear.gif Creates a rewrite rule that will cause any request for an image in the location /images/mdwtc-(3 digits)-(an optional character string with underscores allowed)-(an optional string of digits).gif to be served the image in the location /images/clear.gif In your virthost directive or main server config
Header set Cache-Control "max-age=0, no-cache" This requests that proxy/caching servers not cache this image. server config, virthost directive or .htaccess file (depending on its location, this directive can affect more than just the clear.gif file)
Header set Expires "Wed, 31 Dec 2003 12:00:00 GMT" This requests that the browser not cache this image. The use of this directive is optional and should be based upon your reporting needs. server config, virthost directive or .htaccess file (depending on its location, this directive can affect more than just the clear.gif file)

A 1 X 1 pixel clear gif file will need to be placed at the location $DOCUMENT_ROOT/images/clear.gif

Log Rotation

The reporting logs will need to be periodically rotated in order for them to be transferred for processing. It is recommended that they be rotated every 24 hours. It is suggested that the logs be stored in the format $SERVER_DIRECTORY/logs/rotated/$Mon/log_name.MMDDYYYY

Considerations

If you have . . . You should . . .
One property (domain names) Set up one reporting server
Multiple properties (domain names) Set up your reporting servers so that each domain logs to a separate file