Installation and Use of awstats under IIS

Source: Internet
Author: User

AWStats is a Perl-based web log analysis tool.
Statistical analysis log: Save the result in a TXT file, for example, awstats042009.youlu3.txt

------------------------------------------------
------------------------------------------------
------------------------------------------------
AWStats is written in Perl. Program Therefore, you must first install the ActivePerl (for Win32) program.
1. Install ActivePerl
Download: ActivePerl-v5.10.0.1004.rar
Enter the directory to install, such as E: \ Perl
Next is the next step.
2. Test ActivePerl
The output result to be displayed by AWStats can be CGI or HTML. cgi is recommended.
If ActivePerl is installed by default, the resolution ing of the. pl file is added by default in IIS. Otherwise, you must manually add it.
In iis6.0, you also need to enable "Perl cgi extension" and "Perl ISAPI extension" in "Web Service extension"
Create a new virtual directory and select "Run (such as ISAPI application or cgi)" When setting access permissions )"
For example, if the virtual directory is test, the corresponding physical path is D: \ test.
Create a test. pl file and save it to D: \ test \.
Enter the following Code :
#! E: \ Perl \ bin \ perl.exe
#------------------------------------------------
# Test whether the Web server supports the Perl language parsing Test Program
# It is also a CGI program written in Perl.
#------------------------------------------------
# Code start
Print "Content-Type: text/html", "\ n ";
Print "<HTML> \ n ";
Print "Print "<body> <center> \ n ";
Print "this is a CGI test. \ N ";
Print "Congratulations, your server already supports Perl. \ N ";
Print "</center> </body> \ n ";
Print "# Code end
Open IE and enter http: // localhost/test. pl in the address bar.
If the center occurs in IE, "This is a CGI test. Congratulations, your server already supports Perl. "

------------------------------------------------
------------------------------------------------
------------------------------------------------
Installing AWStats: awstats-6.9.exe
Installation path: e: \ AWStats \
Before installation, check whether the path of the environment variable contains the directory where Perl is located (for example, the path E: \ Perl \ bin after installation ). Add the secret directory to the path.
If you do not enter the Apache path, enter none.
At the end of the installation, the system will prompt whether to create a new configuration file. Select "yes" and enter the name of the site to be counted, for example, youlu3. Then E will be created: \ AWStats \ wwwroot \ cgi-bin \ AWStats. the youlu3.conf file.
Enter-> enter to end the installation.

logs
----------------------------------------------
Use AWStats
1. Set IIS log options
default logs are truncated by day, the log field is set as follows:
date
time
Client IP address c-IP
User Name CS-username
method CS-method
uri resource CS-Uri-stem
Protocol Status SC-status
Number of sent bytes SC-bytes
Protocol version CS-version
User Agent CS (User -Agent)
reference site CS (Referer)
Note: After setting the IIS log option, stop the site, delete site logs, and restart the site.
2 ,. conf File Settings
name example: AWStats. youlu3.conf
AWStats configuration file (AWStats.
# ------------------------------------------------------------------
# The following describes the common basic settings, other settings use the default settings on it
# ------------------------------------------------
logfile: Location of the log file (ex % YY-24 % MM-24 % DD-24 is in 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 cannot use the logformat = 2. For specific settings, use the example of the previous line.

Diricons: Location of the icon directory
Diricons = "/icon"

Sitedomain: Site Statistics (required)
Sitedomain = "http://www.youlu.net /"

Defaultfile: default page of the website
Defaultfile = "default.htm"

Logo = "yoululogo.gif"
Logolink = "http://www.youlu.net /"
* The logo must be in the icon/other directory.

Stylesheet: the position of the style sheet
Stylesheet = "/CSS/awstats_default.css"

Htmlheadsection = "<center> Htmlendsection = "<center> * HTML code can be written without modification.

Include: contains another CONF file
Include "AWStats. Public. conf"
* Note: Inherit the settings of another CONF file (for example, a public setting). The settings of this file overwrite the settings of the inherited file. It facilitates statistics on multiple sites. Set the statistics option in public settings. For other configuration files, you only need to modify the log location (logfile) and site name (sitedomain.
#--------------------------------------------------

------------------------------------------------
------------------------------------------------
------------------------------------------------
Batch Processing Statistics log:
Log statistics method
Create a batch file (such as makelog. BAT) and enter the following content
Perl E: \ AWStats \ wwwroot \ cgi-bin \ AWStats. pl-Update-lang = cn-Config = youlu3
Perl E: \ AWStats \ wwwroot \ cgi-bin \ AWStats. pl-Update-lang = cn-Config = config1
Perl E: \ AWStats \ wwwroot \ cgi-bin \ AWStats. pl-Update-lang = cn-Config = config2
Note: To count several sites, write a few lines and change-Config = xxxx to the configuration file of the site to be counted.
Run the batch processing file every 8 hours (can be made into a scheduled task)

If you need to manually update the statistics page, you must set allowtoupdatestatsfrombrowser = 1 in. conf.
# Allowtoupdatestatsfrombrowser = 1, which appears on the AWStats analysis result page: "update now"
# Allowtoupdatestatsfrombrowser = 0, which is not displayed on the AWStats analysis result page: "Update Now". If it has not been updated, it appears: "Never updated (refer to 'build/Update' on awstats_setup.html ')"
We do not recommend that you set it to 1. If you want to set it to 1, you need to make the following changes:
A) add an account everyone to the active perl directory safely> full control
B) add an account everyone to the IIS log storage directory for Security> full control
C) In the AWStats installation directory, add the account everyone> full control to the \ wwwroot \ cgi-bin \ directory.

------------------------------------------------
------------------------------------------------
------------------------------------------------
Query statistical results (Using CGI)
Create a virtual directory (such as youlu3stats) or site, map it to the wwwroot folder of awstats, and select "Run (such as ISAPI application or cgi)" for access permissions )"
In the address bar, enter http: // localhost/youlu3stats/cgi-bin/AWStats. pl? Config = youlu3

References: http://www.chedong.com/blog/archives/001460.html

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.