- Windows NT 4.0 Workstation
- Windows 2000 Professional
- Windows XP
- Windows NT 4.0 Server
- Windows 2000 Server
- Windows Server 2003, R2
- Windows Server 2008, R2
- Windows Server 2012
- Windows Server 2016
- Windows Server 2019
- Internet Information Services 4.0, 5.0, 5.1, 6.0, 7.0, 7.5, 8.0, 10
- Analog CE
This article discusses how to automate the dissemination of statistics data to multiple web site clients on a typical, single instance production IIS web server. The article discusses the configuration of Analog and the file system considerations required to automate the delivery of statistics to all IIS web sites hosted on the server instance.
In the default Analog CE sample config file, Analog is configured to support a single web site through a single instance of the Analog executive.
In a larger IIS web host environment, a single IIS server may potentially host hundreds or even thousands of individual web sites. In this model, it is necessary to tweak the configuration of Analog to act as a single instance, multi-target model – instead of the default single instance, single target model.
The how-to is split into the following sections:
- What is not covered here
- File System Considerations
- Prepare Analog
- Configure the Analog Server Settings
- Configure the Analog Site Settings
- Running Analog on a Schedule
What is not covered here
This guide is specifically written to demonstrate the configuration of Analog. To that end it does not cover the installation, setup or configuration of IIS in either a manual or an automatic capacity.
This guide will provide you with a scalable solution towards running Analog on a production IIS server, however most administrators will wish to integrate this process into the creation of web sites on IIS.
You will need to ensure that scripts run through an account with appropriate permissions to be able to write to the output folders on your web server. If you are using UAC on your server, ensure that you execute the scripts with elevation.
File System Considerations
By default, IIS provides a separation between the sites web root and the logs associated with that web site instance. By default IIS bases its web site root under c:\inetpub and the log files necessary for Analog to function are stored under c:\windows\system32\LogFiles\<Instance>.
Hosting providers should move these files to a different location, one that is preferably separate from the operating system volume. In most cases, these will be accessible by the tenant. How you wish to do this will depend primarily on whether you want your client users to gain access to the logs or not.
A suggestion for how to structure your web sites on disk in both scenarios is shown below. In both examples the client would FTP directly into d:\sites\<domain> to upload or download content.
|User has access to Logs||User does not have access to Logs|
|In this example the client has access to their own log files (presumably over SFTP). This allows them to download their logs for offline analysis, however you will also generate an Analog report for them into the \stats folder under their web site root folder (\web).||In this example, log files are available for internal users only, you plan to use these to generate a report for the client using Analog into the \stats folder.|
To fit in with the file-system structure outlined above, this guide will assume that the following file system structure is in use:
Copy the contents of the latest Analog CE binary zip file into d:\parser\Analog.
Configure the Analog Server Settings
Analog’s global analog.cfg file must be reconfigured to be site independent so that it becomes the global configuration file. This is achieved by removing all references to a particular web site to create a baseline configuration. In essence, you are creating the default values for all Analog executions that will be used unless overridden in the local config.
Open the analog.cfg file in notepad.
Using the Analog CE Configuration File Generator output as an example, you should remove the highlighted lines to form a baseline configuration.
To save time, disk space and bandwidth it is recommended that you edit the style sheet location inside the baseline configuration to point to a common location
For example, you could create an administrative resource on a separate web to host these resources e.g.
Note: This shared resource site will be equally useful if deploying Report Magic stats along with Analog (not covered in this guide).
Configure the Analog Site Settings
Now that you have created a common baseline for Analog’s global config, the next step is to configure Analog for each of your sites.
Navigating to d:\sites\www.domain.com create a file called analog.cfg
Open this configuration file and this time enter only the information that you removed from the baseline configuration, ensuring that you tailor the settings to this particular web site For example:
You should automate the creation of this configuration file as part of your site creation activities. The fastest way to achieve this is to write the configuration file to the d:\sites\<web site>\analog.cfg as part of your website creation script.
In the above example, a default Analog CE HTML report will be generated in(http://www.domain.com/stats/ to the user).
Ensure that you repeat the creation of this file for all web sites on your server.
Running Analog on a Schedule
Now that Analog has been configured, the last step is to schedule it to run. The simplest way to do this is to use a batch script and the Windows task scheduler.
With some creative scripting (exampled below) you can configure the scheduled job to crawl through the d:\sites folder looking for site-level analog.cfg files to parse through to the Analog CE executable.
The example below should be saved via Windows Notepad as d:\parser\GenerateStats.cmd
This script searches all sub-folders offor the presence of an analog.cfg file e.g. d:\sites\www.mydomain.com\analog.cfg. If it finds one it ensures that there is an appropriate output directory (\web\stats) and then runs the Analog CE executable using the baseline configuration (this is implicit) as well as the local site-level analog.cfg configuration file (explicit) to produce the report.
The report will be output as specified in the site-level analog.cfg.
Any Analog parser errors will be written into the d:\sites\www.mydomain.com folder as analog.log, allowing for analysis by the client.
In Windows Task Scheduler, create a basic task that will run d:\parser\GenerateStats.cmd ever day, 12 hours, 6 hours (or at whatever interval you require).
Once complete, as you add new web sites (and their associated site-level analog.cfg files) or remove old ones they will automatically be picked-up and parsed through the statistics engine without any administrative intervention.