Karatas, FERHAT
I would love to change the world, but they won't give me the source code!
Configuring Awstats for Mulitple web sites
26.06.2009 14:44:33 - Filed under : Asp.net
I explained something about installation Awstats log analyzer tool before. I list all required steps to implement much more web site to use Awstats report. Here we go :


1. Configure W3SVC log format in IIS (in Website tab)

   You should delete all previos log file in Log files directory (ex: C:\WINDOWS\system32\LogFiles\W3SVC129507843) If you can not delete anything in that folder, please try to stop website and delete it again. Then set these properties to enable.

   -  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))

2. Access to web site with Internet explorer/firefox to create sample log file in server's LogFiles directory.

3. Create configuration file in "C:\perl\wwwroot\cgi-bin" (ex : awstats.www.sampledomain.com.tr.conf)

4. Update 3 parameters according to new site.

   - LogFile="C:\WINDOWS\system32\LogFiles\W3SVC129507843\ex%YY-24%MM-24%DD-24.log"
   - SiteDomain="www.sampledomain.com.tr"
   - HostAliases="sampledomain.com.tr www.sampledomain.com.tr"

5. Copy icon folder in "C:\perl\wwwroot\icon" to your root website directory (ex: C:\Inetpub\wwwroot\sampledomain\sampledomain)

6. Create stats folder in web root to publish report (ex : C:\Inetpub\wwwroot\sampledomain\sampledomain\stats)

7. Right click on the stats folder in IIS and select properties, then click documents tab and add default html page name (ex : awstats.www.sampledomain.com.tr.html) Then, move it to first line.

6. Create batch file with following lines (ex : AwstatsService.bat)
 
  C:\Perl\wwwroot\cgi-bin\awstats.pl -config=www.sampledomain.com.tr –update
  C:\Perl\tools\awstats_buildstaticpages.pl -config=www.sampledomain.com.tr -update -lang=en -dir="C:\Inetpub\wwwroot\sampledomain\sampledomain\stats" -awstatsprog="C:\Perl\wwwroot\cgi-bin\awstats.pl"

  Hint : This batch file use previous day log records. see 9th line below if you want to see current traffic.

7. Create scheduled task in Control Panel for batch file (AwstatsService.bat) to run it in anytime.

8. You can access report by http://www.sampledomain.com.tr/stats/

9. Use this batch file (ex : AwstatsCurrent.bat) if you want to see current usage in traffic report.
   
   C:\Perl\wwwroot\cgi-bin\awstats.pl –config=www.sampledomain.com.tr –update –logfile="C:\WINDOWS\system32\LogFiles\sampledomain\W3SVC1370046439\ex090620.log"
   C:\Perl\tools\awstats_buildstaticpages.pl -config=www.sampledomain.com.tr -update -lang=en -dir="C:\Inetpub\wwwroot\sampledomain\sampledomain\stats" -awstatsprog="C:\Perl\wwwroot\cgi-bin\awstats.pl"

   Because AwstatsService.bat (in 6th item)  use previous day log records.
   Note : You should change logfile name that end of first line everyday. (ex090620.log)

10. Note : Don't run batch file (ex : AwstatsCurrent.bat) in 2 minutes again.

Keywords : Awstats configuration for multiple web sites.
with 0 comments

What do you think ?
Security Code 909
Check S. Code
Name  
Email  
Home Page  
Comments