JKL Toy Company enables cookie tracking on HTTP Server (powered by Apache)

 

In the IBM HTTP Server for i5/OS, you can enable cookie tracking.

Information for this topic supports the latest PTF levels for HTTP Server for iSeries . IBM recommends that you install the latest PTFs to upgrade to the latest level of the HTTP Server for i5/OS. Some of the topics documented here are not available prior to this update. See IBM Service for more information.

 

Scenario

The JKL Toy Company (a fictitious company) wants to be able to measure Web site visitor activity and trends. The JKL Web administrator would like to try to measure how many new and unique users visit the intranet Web site. Requiring users to obtain a userid and password is the most accurate way track users; however, this method has the disadvantage of forcing the intranet Web users to register for a userid and password. Analyzing the data in the log file by IP address could be used to track users. Two disadvantages to this method are:

Setting a unique number in a cookie in the user's browser the first time that they visit the Web site combined with using a log that records cookies could be used to track users. This log can be analyzed to show how many new cookies have been set and how many old cookies have returned. In addition, the log can also be used to show the sequence of URLs that a particular cookie used to navigate through the Web site. A downside of this method is that users can shut off the browsers ability to record cookies.

The JKL Web administrator has decided to use the cookie method. The JKL Web administrator will store cookie information in a new log called JKLCOOKIE_LOG using a new cookie called JKLCOOKIE.

 

Prerequisites

 

Start the IBM Web Administration for i5/OS interface

Enter your Webmaster user profile username and password when prompted.

  1. Start a Web browser.

  2. Enter http://[iSeries_hostname]:2001 in the location or URL field .

    Example: http://jkl_server:2001

    If you have changed your port number for the Web Administration for i5/OS interface, replace port 2001 with your port number.

  3. Click IBM® HTTP Server for iSeries.

If the Web Administration for i5/OS interface does not start, see Installing and testing the HTTP Server.

 

Create a cookie for HTTP Server (powered by Apache)

  1. Click the Manage tab.

  2. Click the HTTP Servers subtab.

  3. Select your HTTP Server (powered by Apache) from the Server list.

    Example: JKLTEST

  4. Select Global configuration from the Server area list.

  5. Expand Server Properties.

  6. Click Logging.

  7. Click the User Tracking (Cookies) tab in the form.

  8. Select Enabled from the Track user requests in a cookie list.

  9. Enter a name for the cookie in the Cookie name field or use the default.

    Example: JKLCOOKIE

  10. Enter a value in the Expiration period field.

    Example: 1

  11. Select a time period from the Expiration period list.

    Example: Years

  12. Click OK.

 

Set up the cookie log for HTTP Server (powered by Apache)

  1. Click the Manage tab.

  2. Click the HTTP Servers subtab.

  3. Select Global configuration from the Server area list.

  4. Expand Server Properties.

  5. Click Logging.

  6. Click the Custom Logs tab in the form.

  7. Click Add under the Custom logs table.

  8. Enter logs/[log_name] in the Log column.

    Example: logs/jklcookie_log

  9. Select cookie from the Log format list.

  10. Enter a value in the Expiration field.

    Example: 364

  11. Select a time period from the Expiration list.

    Example: Days

  12. Click Continue.

  13. Click OK.

The rest of the fields on this form are optional.

 

Restart your HTTP Server (powered by Apache)

Select one of the following methods below:

Manage one server

  1. Click the Manage tab.

  2. Click the HTTP Servers subtab.

  3. Select your HTTP Server from the Server list.

  4. Click the Stop icon if the server is running.

  5. Click the Start icon.

Manage all servers

  1. Click the Manage tab.

  2. Click the HTTP Servers subtab.

  3. Select All Servers from the Server list.

  4. Click the All HTTP Servers tab.

  5. Select your HTTP Server name in the table.

    Example: JKLTEST

  6. Click Stop if the server is running.

  7. Click Start.

If your HTTP Server (powered by Apache) does not start, see Troubleshooting.

 

Test your HTTP Server (powered by Apache)

  1. Open a new Web browser.

  2. Turn cookie alerts on in your browser. Consult the Web browser's help documentation for details on enabling cookie alerts.

  3. Enter http://[iSeries_hostname]:[port] in the location or URL field.

    Example: http://jkl_server:1975

 

View your HTTP Server (powered by Apache) configuration

Your configuration will look similar if you used the given example in this and previous examples.

  1. Click the Manage tab.

  2. Click the HTTP Servers subtab.

  3. Select your HTTP Server (powered by Apache) from the Server list.

    Example: JKLTEST

  4. Expand Tools.

  5. Click Display Configuration File.
Listen *:1975
DocumentRoot /www/jkltest/htdocs ServerRoot /www/jkltest Options -ExecCGI -FollowSymLinks -SymLinksIfOwnerMatch -Includes -IncludesNoExec -Indexes -MultiViews LogMaint logs/jklcookie_log 364 0
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%{Cookie}n \"%r\" %t" cookie LogFormat "%{User-agent}i" agent LogFormat "%{Referer}i -> %U" referer LogFormat "%h %l %u %t \"%r\" %>s %b" common CustomLog logs/access_log combined CustomLog logs/jklcookie_log cookie SetEnvIf "User-Agent" "Mozilla/2" nokeepalive SetEnvIf "User-Agent" "JDK/1\.0" force-response-1.0
SetEnvIf "User-Agent" "Java/1\.0" force-response-1.0
SetEnvIf "User-Agent" "RealPlayer 4\.0" force-response-1.0
SetEnvIf "User-Agent" "MSIE 4\.0b2;" nokeepalive SetEnvIf "User-Agent" "MSIE 4\.0b2;" force-response-1.0
CookieTracking On CookieName JKLCOOKIE CookieExpires 31536000
<Directory />
	Order Deny,Allow 	Deny From all </Directory>
<Directory /www/jkltest/htdocs>
	Order Allow,Deny 	Allow From all </Directory>

 

Parent topic:

Scenarios for HTTP Server