Running AWStats
Running AWStats is quite simple: You need run only awstats.pl and awstats_buildstaticpages.pl; however, you do need to provide some parameters. The main parameter is -config, which defines the configuration file used by the program to analyze data and create reports.
Eventually, you’ll schedule report generation automatically, but at first it’s useful to run AWStats directly from the command line, both to see how it works and to test that your configuration files are OK. First, create an awstats.www.companysite.com.conf file in your bin folder as described in the previous section. You will need to have an IIS log file to analyze, so you can point your .conf file at the log file you specified using the IIS MMC.
Now select Start, Run, and enter the command cmd.exe /f:on. In the command window that opens, change directories to the bin folder that contains all the AWStats resources.
To run your first analysis, enter the command:
awstats.pl -config=www.companysite.com |
That command causes AWStats to open your log file, analyze it, show the results, and then end. If everything worked, you’ll find a new file in your bindirdata folder. The actual file name depends on the configuration file name, the analyzed month, and so on. If any problems occur (you can check this from the results report), make sure that your Perl interpreter is installed and working, your .conf files are defined correctly, and that your IIS log file is in the correct format, and exists in the location where AWStats expects to find it. If you find that AWStats failed to decode only some rows (the results will indicate such problems), don’t panic. If most rows are decoded, that’s Ok; otherwise you probably have problems with your IIS log format.
Run the same command again. AWStats now runs very fast, skipping all the records it’s already analyzed. That’s because it builds on old data, checking and analyzing only new records in the IIS log.
After analyzing the log data, you can make AWStats create a report. Create a folder to contain the report (for this example, I used E:Reports, and copy the binicon folder to it. Also create a www.companysite.com directory in this folder, to archive all report files for this particular configuration/Web site (you can create a different folder for each configuration/Web site you manage). Now, from the same command window you used previously, run this command:
awstats_buildstaticpages.pl -update -config=www.companysite.com -- dir=E:Reportswww.companysite.com -diricons=../icon |
Make sure to change the path to the report path you created. The preceding command causes AWStats to create an HTML-formatted report in the specified folder. You can open the HTML file with a browser to see the analyzed data.
As you can see, after setting up the correct folders and configuration, analyzing log data and creating reports requires running only two scripts. In fact, you actually need to run only buildstaticpages.pl, because that runs awstats.pl in the background. Remember, you launched it manually only to check the output and verify that the environment is OK.
So, scheduling report generations is simple; however, you still need to keep security in mind—a topic I’ll discuss a little later.
Some Tips for Running AWStats
AWStats is powerful and simple to use, but it does have some problems running on Windows. To save you time, I’ve created a list of tips that you can use to run AWStats with fewer problems.
This article was originally published on DevX.com.
Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved
Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.