Was this page helpful?

Install AWStats on Windows Server 2008 and monitor search

  • We have highlighted your search term iis 7 windows server 2008 r2 awstats for you. If you'd like to remove the search term, click here.

This tool is really good for gathering statistics about a MindTouch site. It is very customizable. Some people in the forums wanted to be able to watch how people searched. This is of great use for tagging pages. If it seems like someone is trying to find something (Searching with many variants of the same kind of phrase) then a tag may be required.

Features

Statistics on:

  • How many pages were viewed/loaded per month, day, hour, etc.
  • Top pages, downloads and visitors.
  • Top operating systems, browsers and connections of visitors.
  • Top status codes sent to the client.
  • Search terms and queries used to find the site
  • Search queries for content in the site. See the section on setting this up.

There is more on the website.

How to set it up

Roughly following the attached pdf helps a lot. Though it is actually for IIS6 (and IIS5 for some of it), a lot of it has nothing to do with IIS6.

Steps

Installing and Testing ActiveState Perl (ActivePerl)

NOTE: Make sure the directory for Perl is C:\Perl

  • After the installation is complete, open up notepad and add the following:
#!/usr/bin/perl
print "Hello World.\n";
  • Save it as hello.pl in the C:\Perl directory
  • Start -> run -> cmd
  • run:
C:\Perl\hello.pl 
  • If the words "Hello World" are displayed, then congratulations, ActivePerl has been installed correctly.
    • If not, re-install ActivePerl until it does.

Installing AWStats

  • Download AWStats from the AWStats website:
  • After the download completes, install AWStats with the default options.
    • During the install, a Perl window will appear and complain that it can't find Apache. Type 'none' to skip this step.
    • Agree to build an AWStats profile
    • Give it a name for the site (in this example MINDTOUCH is used) from here on out this will be called {MINDTOUCH}.
    • ENTER again to finish.
  • Run over to C:\Program Files\AWStats\wwwroot and copy every folder into C:\inetpub\wwwroot\AWStats (Create AWStats if it isn't there already.)
  • Create a new directory in that folder called "data"
  • Give IIS_USERS modify permission on "data"

Setting up Perl in IIS7

  • Run IIS Manager
    • Start -> run -> inetmgr
  • Click on the server that the MindTouch site is on in the left sidebar.
  • Click on sites in the left sidebar.
  • Click on Default Web Site in the left sidebar.
  • Click on Handler Mappings in the main window.
  • Make sure that there is a Handler that handles *.pl files. If there isn't,
    • Click "Add Script Map" in the right sidebar (Or right-click anywhere in the main window) and use the following to create one:
      • Request path:        *.pl
      • Executable:            C:\Perl\bin\perl.exe "%s" %s
      • Name                     ActivePerl
    • Click "Request restrictions
      • Check the "Invoke handler only if request is mapped to" and choose "File" on the "Mapping" tab
      • Check "One of the following verbs" and add "GET, HEAD, POST" in the "Verbs" tab
      • Check "Script" in the "Access" tab.
    • Breathe.
  • Restart the Default Web Site. (for good measure)

Setting up a statistics site

  •  Right-click on the site and choose "Add Application..."
    • Use the following to create the AWStats application:
      • Alias:                stats
      • Physical Path:    C:\inetpub\wwwroot\AWStats
  • Run over to the MindTouch install folder and modify \web\bin\IsapiReqrite.ini to add:
RewriteCond %{URL} ^(?!/(stats|stats/.*)&)

After:

RewriteCond %{URL} ^(?!/(@api|editor|skins|config|deki)/)
  •  Restart the site (shouldn't be down long.)

Setting up logging

  • Click on the MindTouch site in the left side-bar
  • Double-click on Logging in the main window
  • Make sure that W3C is chosen in the Format section.
  • Click the "Select Fields" button.
  • Make sure the following are checked (They don't need to be the ONLY ones checked):
    • Date (date)
    • Time (time)
    • Client IP Address (c-ip)
    • Username (cs-username)
    • Method (cs-method)
    • URI Stem (cs-uri-stem)
    • URI Query (cs-uri-query)
    • Protocol Status (sc-status)
    • Bytes Sent (sc-bytes)
    • Protocol Version (cs-version)
    • User Agent (cs(User-Agent))
    • Referrer (cs(Referrer))
  • Make a note of the location (Change it if desired, old files will be removed as they won't work with AWStats if they don't have any one the above listed).
  • Schedule log file creation daily
  • Click Apply in the right sidebar
  • Browse to the location of the log files
  • Stop the MindTouch site and delete every log there.

NOTE: The site must be stopped so that IIS doesn't have a lock on the most recent log file.

  • Start the site and browse to a page
  • Verify that a new log file was created in the log directory
  • Open the log file and copy everything after "#Fields:" on the same line. Replace {YOUR LOG FORMAT} with this line.
  • Open C:\inetpub\wwwroot\AWStats\cgi-bin\awstats.{MINDTOUCH}.conf
  • Set the following:
LogFile="{path to log-file}\u_ex%YY%MM%DD.log"
LogType=W
LogFormat="{YOUR LOG FORMAT}"
LogSeparator=" "
SiteDomain="www.mydomain.com"
HostAliases="www.mydomain.com"
DNSLookup=1
DirData="C:\Inetpub\wwwroot\awstats\data"
DirCgi="/cgi-bin"
DirIcons="../icon"
  • Note that the log-file could be saved as u_ex%YY%MM%DD.log or ex_%YY%MM%DD.log based on settings and such.
  • Be sure to change www.mydomain.com to something relevant.
  • Save and close.

Testing and Running

  •  Run the following:
C:\Inetpub\wwwroot\AWStats\cgi-bin\awstats.pl -config={MINDTOUCH} –update
  • Some output should be displayed but no errors (cross your fingers)
  • If there were no errors, visit the statistics site.
  • Point favorite browser to:
  • 		http://mindtouch_site/stats/cgi-bin/awstats.pl?config={MINDTOUCH}
  • A pretty, formatted, html page should be displayed.

Note that AWStats does not update automatically unless a task is set in Task Manager. Running once an hour every day is suggested. Just set it to run the update command at the beginning of this section.

Setting up to monitor search on MindTouch

AWStats allows for customization by having a section dedicated to custom tables. The documentation of AWStats goes so far as to say that each additional section adds 8% more of a load. Luckily, only one is needed for monitoring search.

Enabling search statistics is easy, just add this to the end of the config file (C:\inetpub\wwwroot\AWStats\cgi-bin\awstats.{MINDTOUCH}.conf):

ExtraSectionName1="Search results"
ExtraSectionCodeFilter1="200 304"
ExtraSectionCondition1="URL,(\/index.php)"
ExtraSectionFirstColumnTitle1="Phrase"
ExtraSectionFirstColumnValues1="QUERY_STRING,search=([^&]+)"
ExtraSectionFirstColumnFormat1="%s"
ExtraSectionStatTypes1=PL
#ExtraSectionAddAverageRow1=0
#ExtraSectionAddSumRow1=1
MaxNbOfExtra1=20
MinHitExtra1=1

To monitor past searches, delete everything in the \data folder (C:\Inetpub\wwwroot\AWStats\data) and run the update command. (It might take a while...)

That will show the top 20 search results. To change that number, change MaxNbOfExtra1.

Helpful resources

Was this page helpful?
Tag page

Files 1

FileVersionSizeModified 
Viewing 4 of 4 comments: view all
This is a great reference, could you let me know what version this is for?
I am trying to set it up on IIS 6.0 powered by MindTouch Core v.9.02.4
When I try to visit http://qualitywiki.arrow.com/stats/cgi-bin/awstats.pl?config=qualitywiki the wiki creates a new page.
Did I miss something?
Posted 09:32, 2 Sep 2009
I am stuck at this step:
Run over to the MindTouch install folder and modify \web\bin\IsapiReqrite.ini to add:
RewriteCond %{URL} ^(?!/(stats|stats/.*)&)

I don't see this file anywhere IsapiReqrite.ini
I am using IIS7 with Windows Server 2008 R2 Enterprise SP1 64-bit edited 06:00, 18 Oct 2011
Posted 05:59, 18 Oct 2011
dtolj,

The file has been renamed 'iirf.ini' and is in the web directory in your install.

Thanks!
Posted 06:45, 18 Oct 2011
brianh,
I still don't see it. I just installed IIRF but the config file is nowhere to be found. I also installed URL Rewrite2.0 utility as an IIS feature.
I also have Sharepoint installed, can Perl and sharepoint coexist? edited 07:30, 18 Oct 2011
Posted 07:13, 18 Oct 2011
Viewing 4 of 4 comments: view all
You must login to post a comment.

Copyright © 2011 MindTouch, Inc. Powered by