Installing AWStats for Web Statistics Analysis in WAMP
AWStats is a powerful and free website log and metrics presentation and analysis tool that enables website owners and operators to get both a summary, and a detailed view of traffic origins, demographics, and destination pages.
Having installed all the basic infrastructure for a WAMP web server and a WCM system, it is necessary to have a tracking tool that can aid in the interpretation of the log file(s) that Apache generates and make meaning of the numbers so as to swiftly and accurately make decisions relating to content management and Web Marketing.
An impressive candidate for this task is AWStats. It is swift, web based and very detailed in addition to be being a frequent choice for reputable hosting companies. The fact that it's free does not hurt either.
Requirements
Perl/CGI engine
Web server (Apache 2.0.55 in this case)
Perl/CGI Engine
This is made possible by installing ActiveState Perl for Windows. It will detect both IIS and Apache and make some recommendations on how to configure it. That task is straight-forward and show work as explained. Please remember to restart your server OS and Apache so that the %PATH additions will take place and Windows will know where to find perl.exe. Also, you may be prompted to add an ISAPI line in the IIS configuration so that IIS can know what to do with *.pl files (just the same way that we did for PHP installation). This may sometimes be done automatically, but it does nto hurt to check and make sure that IIS is configured to refer all *.pl requests to the Perl.exe or other perl engine that you choose to point to. I say 'other' because the installation of Perl provides you with several CGI engine-files.
AWStats Installation
The automated installation will place the application all all kinds of places. To maintain control, since this is not an application that needs to add registry keys, all you need to do (I make it sound so simple) is to make sure that you make adjustments to the config file that refers to the web server you want to track.
Make sure that:
- You modify the CGI reference at the top of the 3 *.pl file sin the awstats/cgi-bin folder to that they can properly reference the Perl engine.- The references to the log file is done properly without the # at the beginning of an absolute path to the Windows file system
- Since Windows does not have cron-tab by default (Here is how to implement CronTab in Windows), it is smart to make it so that updates can be done from CGI/web view (if the log file is large, this could cause timeout if not done often) so modify the config file to enable an update button in the view.
If you need step by step detailed instructions, please comment on this entry and I will be glad to walk you though or drop me some feedback.
Restricting Access to Metrics
This can be accomplished by restricting the IP addresses or block of IPs that have access to scripts in AWStats from Apache as explained in this post.
403 errors on Perl *.pl files
This small problem can sometimes lead to a whole lot of hair-loss; at least for me it took about 3 hours of configuring and reconfiguring every line in apache before I remembered that I had previously moved the WCMS to the root folder and the relevant .htaccess file with it. This particular .htaccess file has a line in it blocking access to *.pl files along with other application-only files such as *.module, *.inc, *.sql etc. Much as .htaccess files are meant to help secure applications, if you do not pay special attention to seek them all out and modify them, you could spend a lot of time reading configuration manuals. The silver lining in all of this is that I now understand the configuration of Apache for perl much better and I got to read some good documentation.


