Awstats installation instructions

  
                  

Introduction
AWStats is a Perl-based WEB log analysis tool.

AWStats operation mode
1, statistical analysis log: Save the results in a txt file, the latest version supports xml data format. 2, output analysis results: use cgi program output, or generate static html files for browsing.

Installing under Windows
AWStats is a program written in perl language, so you must first install the ActivePerl (for win32) program.

1. Install ActivePerl
Download the compressed package. After unzipping, run Installer.bat. Enter the directory to be installed, such as D:\\Perl and then basically go all the way back. When asked to enter the path to Apache, if not, please enter: none. Finally, follow the prompts and type: return to end the Perl installer.

2. Test ActivePerl
The output of AWStats to display is in two ways: cgi and html, cgi is recommended. If ActivePerl is installed by default, the parsing map of the .pl file will be added by default in IIS. Otherwise it will be added manually. In IIS6.0, you also need to enable "Perl CGI Extension" and "Perl ISAPI Extension" in the "Web Service Extension", as shown in the figure: Create a new virtual directory and select " when setting access rights. Execution (such as ISAPI application or CGI) " as shown: For example: virtual directory is test, corresponding physical path is D:\\test New test.pl file, save to D:\\test\\ and enter the following code: # !d:\\perl\\bin\\perl.exe # -------------------------------------- ---------- # Test whether the WEB server supports the test program for perl language parsing # is also a cgi program written in perl language # ----------------- ------------------------------- # Code Start print "content-type:text/html","\ \ "; print "<html>\ "; print "<head><title>test</title></head>\ "; print "<body><center> ;\ "; print " This is a CGI test. \ "; print " Congratulations, your server already supports PERL. \ "; print "</center></body>\ "; print "</html>\ " # Code End Open IE, enter http://localhost/test in the address bar /test.pl if there is a centered " in IE; this is a CGI test. Congratulations, your server already supports PERL. " Description set successfully! As shown below:

3, install AWStats
Before installation, it will detect whether the environment variable path contains the directory where perl is located (such as the path D:\\Perl\\bin just installed). If there is no perl path in the path, AWStats will pop up a message, you can choose to skip (skip), but in order to ensure the convenience of future use, it is recommended to add the directory where perl.exe is added to the path. At the end of the installation, you will be prompted to create a new configuration file, select Yes (y), enter the name of the site to be counted, such as www.45it.com, there is nothing else to pay attention to.

Using AWStats

1. Setting IIS Log Options
The default log is truncated by day. The log fields are set as follows: Date date ◇ Time time ◇ Customer IP address c-ip ◇ User name cs -username ◇ method cs-method ◇ URI resource cs-uri-stem ◇ protocol state sc-status ◇ number of bytes sent sc-bytes ◇ protocol version cs-version ◇ user agent cs (User-Agent) 引用 reference site cs (Referer

2, .conf file settings
Names such as: awstats.test.conf See the appendix for specific settings.

3, statistical log
See the appendix.

4, access statistics (using CGI)
Create a virtual directory (such as awstats), map to the wwwroot folder of AWStats, access permissions should select "execute (such as ISAPI application or CGI)" Enter http://localhost/awstats/cgi-bin/awstats.pl?config=test in the address bar as follows: ========================= ====================================================================== :

Common Settings for AWStats Configuration File (awstats.mysite.conf)
#------------------------- -------------------------------------------------- ----------# The following instructions are common basic settings, other settings use the default settings. #---------------------- -------------------------------------------------- -------------- LogFile: The location of the log file (ex%YY-24%MM-24%DD-24 is the last 24 hours format) LogFile="C:/WINDOWS/system32 /LogFiles/W3SVC1/ex%YY-24%MM-24%DD-24.log" LogType: log type (W-web log; M-mail log; F-ftp log) LogType=W LogFormat: log format (1 -Apache or Lotus Notes log format; 2- IIS log format) LogFormat="date time cs-method cs-uri-stem cs-username c-ip cs-version cs(User-Agent) cs(Referer) sc-status sc-bytes"*Note: IIS6.0 Can not use the format of LogFormat=2, please refer to the example of the previous line. DirIcons: The location of the icon directory DirIcons="/icon" SiteDomain: Statistics site (must be set) SiteDomain="www.45it.com" DefaultFile:Website The default page DefaultFile="index.html" Logo="corplogo.jpg"LogoLink="http://www.45it.com"*logo must be in the icon/other directory StyleSheet: Style sheet location StyleSheet ="/css/awstats_default.css" HTMLHeadSection="<center><h1>This is the page header</h1></center>"HTMLEndSection="<center><h1> This is the end of the page </h1></center>"* can write html code Include: contains another conf file Include "awstats.public.conf" Description: First inherit the settings of another conf file (such as a Public setting , Setting overwrite the file of the inherited file. Mainly convenient for statistics of multiple sites. Set the statistics option in the public settings. Other configuration files only need to modify the log location (LogFile) and the name of the statistical site (SiteDomain). -------------------------------------------------- -------------------------------------------------- * Modify the 667~687 lines of the awstats.pl file, you can remove the original information and add your own information ---------------------------- -------------------------------------------------- -----------------------

Method of statistical log
Create a batch file (such as makelog.bat), enter the following in it Perl X:\\AWStats\\wwwroot\\cgi-bin\\awstats.pl -update -lang=cn -config=mysiteperl X:\\AWStats\\wwwroot\\cgi-bin\\awstats.pl -update -lang=cn -config=config1perl X :\\AWStats\\wwwroot\\cgi-bin\\awstats.pl -update -lang=cn -config=config2 Note: You need to count several sites, just write a few lines, and modify -config=XXXX to configure the site's configuration file every day. Run the batch file at regular intervals (can be used as a scheduled task)

Copyright © Windows knowledge All Rights Reserved