GuidesAnalyzing IIS6 Web Logs With AWStats Page 4

Analyzing IIS6 Web Logs With AWStats Page 4

ServerWatch content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

Scheduling AWStats

Even though you’re using AWStats in offline mode, you probably want to create updated reports automatically. The simplest way to do this is to use the Windows scheduler. First, create a new standard user account on the Web server (or in Active Directory) with no extended rights (you can create the account in the Users group). It’s a good idea to assign a strong password to this account. You’ll use the account to create a scheduled task and nothing else.

Next, create a batch file to launch data analysis for each Web site for which you want to create reports. Here’s a typical batch file that analyzes three separate Web sites on the server:

    start /low /wait -update 
      -config=www. -diricons=../icon
   start /low /wait -update -diricons=../icon
   start /low /wait -update 

Save the file with a .bat extension. Note that the batch file uses start.exe rather than running the Perl scripts directly because Perl is an interpreted language, and you cannot define a task priority or a maximum CPU usage value when you run a Perl program. Running the commands with start.exe, and passing the /low parameter runs Perl in low-priority mode, letting the Windows process scheduler assign more CPU time to standard programs, and running the log analyzer with less impact on the overall system. The /wait option causes start.exe to wait until program execution completes before running the next command. If you omit the /wait option, the batch file will launch all the defined AWStats processes (three in this case) at one time, which will consume too many server resources.

Using a similar batch file and the user you defined, you can create an NT scheduler task to update your log reports at off-peak times and at convenient intervals.

Security and NTFS settings

When you schedule (or run) a program, it’s best to restrict its permissions as much as possible. To create reports, you can assign NTFS permissions to the user account you created to run the scheduled task. You’ll have to assign these permissions:

  • Execute, on c:program filesperl
  • List folder contents only (or the less restrictive read option) on the root folder where you put the AWStats files (the root of the disk containing the bin folder)
  • Execute, on the bin folder
  • Modify, on the bindirdata folder
  • Read, on the folder containing the IIS logs
  • Modify, on the folder where you want AWStats to create the report files

Setting only these permissions restricts file and folders access to the user account running AWStats — and it’s a common “best practice” for every server and application.

AWStats has many additional options and features beyond the ones mentioned here. You can find the complete documentation online, so you can easily find and test additional features yourself. The documentation is quite Linux-centric, but after you get AWStats working on Windows as described in this article, you’ll find that you can refer to the documentation with few problems.

This article was originally published on

Get the Free Newsletter!

Subscribe to Daily Tech Insider for top news, trends & analysis

Latest Posts

Related Stories