Setting up your Web Server to Log Visits for tracking

Setting up the way how your Web Server logs visits is crucial to track visits to your web site.
Surfstats Web Site Traffic Analyzer (Log Analyzer) and SurfstatsLive require web server log files to analyze and track visits to your web site.

Apache Server Setup

Please refer to http://httpd.apache.org/  for detailed documentation on the Apache web server.
For Apache log files specify the Log file date format on the Log Format tab by editing the site profile.

Do not use the Multi File Logs as combined log files are easier to handle. You can configure Apache to generate combined log files by editing the "httpd.conf" file in the /Apache/conf/ directory and change entries as follows:

  • Specify the log file format with the LogFormat directive, example: LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
  • Specify that you want a combined log file stored and the location, for example: CustomLog logs/combined.log combined.

Some web site hosts supply their clients with Multi File (separated) log files. With this configuration the web server logs to three separate files, instead of one combined file:

  • access log - this contains the date/time and file accessed
  • referrer log - this contains the referrer information
  • agent log - this contains the browser or "agent" information.

In SurfStats you need to set up the profile to handle separate log files as follows. Only select the access log when specifying this log file type in Surfstats. The other log files will be added automatically. You should also enable the Multi File Logs option on the site profile.

Please note that Multi File logs are outdated and will not be supported by newer versions of Surfstats anymore.

IIS Server Setup

Please refer to Microsoft's web site for detailed documentation on the Microsoft IIS web server.

We suggest using the W3C Extended Log File Format as it is the only IIS5/6 format that logs Browser/Platform and Referrer info on IIS (Internet Information Server). SurfStats also supports the other available IIS types. To set up logging in IIS do the following:

Click on Start - Programs - Administrative Tools - Internet Service Manager - select your server and web site- right click on it and select Properties - Choose Active log format (W3C Extended Log File Format) - Click on Properties - Extended Properties and select the fields to log.

We recommend the logging of all the fields on the Extended Properties tab. Stop and start the web server after editing the properties to log. Create an entry in the log file by accessing your web site with a browser and check if the entry is correctly logged in the log file. At least the following fields should be logged:

· Date
· Time
· Client IP address (c-ip)
· User Name (cs-username)
· Server IP address (s-ip)
· Server Port (s-port)
· Method (cs-method)
· URl Stem (cs-uri-stem)
· Url Query (cs-uri-query)
· Protocol Status (sc-status)
· Bytes sent (sc-bytes)*
· Bytes received (cs-bytes)*
· User Agent (cs(User-Agent))* - for browser information
· Cookie (cs(Cookie))* - for cookie information
· Referer (cs(Referer))* - for referrer information

Fields marked with an * are NOT logged by IIS by default.

Of particular importance is the Protocol Status field. Sometimes logging of this field is turned off with the result that SurfStats produces no reports. This field contains the status code for the HTTP request (e.g. 200 for success, 404 for page not found etc.). This field is crucial in log file analysis.

Please note that IIS reserves and locks a 64 KB block in the current log file it is logging to. The current 64 KB block in use cannot be added to the reporting database. Some clients reported an error “Database empty” and expected this information to be added to the database.

Also note that the default setting for ASP buffering is ON in IIS5/6. This causes the sc-bytes field to be logged as 0 as the web page is served from the web server's cache. You should switch ASP buffering OFF to log this field. If you do not do this, you will not be able to track bandwidth in reports on ASP files.
 

 Home | Contact Us | Site map | |Privacy Policy | Disclaimer
  ©2011 SurfStats Software. All rights reserved.