AWStats Introduction: log analysis tools for Apache/IIS (1)

Source: Internet
Author: User
Tags geoip unpack install perl maxmind

You do not have to patiently read all the content: brief installation instructions are as follows:

Install

Http://sourceforge.net/projects/awstats/ download installation package:
GNU/Linux: tar zxf awstats-version.tgz

Awstats scripts and static files are all in the wwwroot directory by default: deploy all the files in the cgi-bin directory to the cgi-bin/directory: /home/apache/cgi-bin/awstats/

Mv awstats-version/wwwroot/cgi-bin/path/to/apache/cgi-bin/awstats

Copy the file directories such as icons to the HTML file publishing Directory on the WEB, for example, publishing more batch update scripts under/home/apache/htdocs, you can put it in the cgi-bin/awstats/directory to upgrade the domestic main search engine and spider definition, and install the GeoIP application library: C

Http://www.maxmind.com/download/geoip/api/c/ unpackage, compile and install perl-MCPAN-e 'Install "Geo: IP" 'or use a pure Perl Package perl-MCPAN-e' install "Geo: IP :: purePerl "'

Download the GeoIP/GeoIPCityLite package: unpackage and deploy it to the awstats directory.
Http://www.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
Http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz

Configuration

Name the default awstats. model. conf as common. conf.

Modify some of the configuration options:
LoadPlugin = "decodeutfkeys"
LoadPlugin = "geoip GEOIP_STANDARD/home/apache/chedong.com/cgi-bin/awstats/GeoIP.dat"
LoadPlugin = "geoip_city_maxmind GEOIP_STANDARD/home/apache/chedong.com/cgi-bin/awstats/GeoLiteCity.dat"
Create an awstats Directory: data directory for statistical data output
Set the configuration file as follows:

Include "common. conf"
LogFile = "/home/apache/logs/access_log. % YYYY-24 % MM-24 % DD-24"
SiteDomain = "www.chedong.com"
HostAliases = "chedong.com"
DefaultFile = "index.html"
DirData = "/home/apache/cgi-bin/awstats/data /"

Summary:AWStats usage introduction and configuration improvement instructions. We are glad to see that at the beginning of AWStats 6.3, Chinese users basically only need to enable LoadPlugin = "decodeutfkeys" in the configuration file, so there is basically no statistical problem with the Chinese search engine, # Minor chinese search engines 'Baidu \. com ', 'search \. sina \. com ', 'search \. sohu \. com ', the three search engines. Includes patches defined for major search engines and spider in China (unpack and overwrite the original program directory under the lib \ directory)

The log statistics system plays an important role in site user behavior analysis, especially for keyword access statistics from search engines: it is a very effective data source for user behavior analysis. With the development of the Internet over the years, WEB Log statistics tools have become more and more mature and feature-rich. Many of them are open source code, and AWStats is an excellent one.

AWStats: Advanced Web Statistics

AWStats is a fast-growing Perl-based WEB log analysis tool on Sourceforge. Compared With Webalizer, an excellent open-source log analysis tool, AWStats has the following advantages:

  1. User-friendly: You can directly call the Simplified Chinese version of the corresponding language interface based on your browser)
    Reference output sample: http://www.chedong.com/cgi-bin/awstats/awstats.pl? Config = chedong
  2. Perl-based: the system can run on GNU/Linux or after ActivePerl is installed on Windows. The log analysis directly supports the Apache format (combined) and IIS format (need to be modified ). Although Webalizer has a Windows platform version, it lacks maintenance;
    AWStats allows you to use a system to collect statistics on different WEB servers on your website: GNU/Linux/Apache and Windows/IIS servers.
  3. High Efficiency: the AWStats output statistics project is much richer than Webalizer, and the speed can still reach about 1/3 of Webalizer. This speed is sufficient for websites with millions of daily visits;
  4. Convenient configuration/customization: The system provides flexible but reasonable configuration rules by default. The default configuration to be modified cannot exceed 3 or 4 items to start running, there are also many plug-ins for Modification and extension;
  5. AWStats designers are designed for precise "Human visits", so robot access to many search engines is filtered out, therefore, the statistics may be lower than those of other log statistics tools. Access from within the company can also be filtered out through IP address filtering settings.
  6. Provides many extended Parameter Statistics functions: using the ExtraXXXX series configuration to generate Parameter Analysis for specific applications is very useful for product analysis.

For more information about Webalizer and analog, see:
Http://awstats.sourceforge.net/#COMPARISON

AWStats installation memo

The AWStats running mode is as follows:

  1. Analyze logs: after running, archive the log statistical results to an AWStats database plain text;
  2. Then there is the output in two forms:
      • One is to read the statistical result database output through the cgi program;
      • One is to run the background script to export the output to a static file;

      The following are two log statistics examples for a single site:
      One is CGI-based output on GNU/Linux,
      One is static page-based export on Windows 2000

      ◆ Download/install http://sourceforge.net/projects/awstats/ download installation package after:

      GNU/Linux: tar zxf awstats-version.tgz
      By default, awstats scripts and static files are stored in the wwwroot Directory: deploy awstats. pl programs to/home/apache/cgi-bin/awstats /.
      Mv awstats-version/wwwroot/cgi-bin/path/to/apache/cgi-bin/awstats
      # Copy the icons and other file directories to the HTML file publishing directory of the WEB:/home/apache/htdocs/
      More batch update scripts can be stored in the cgi-bin/awstats/directory under the tools directory,

      Windows 2000: Run in Script Mode on the background. Unpack the package and move it to the D: \ AWStats directory.
      Copy the icon directory to the publishing directory of IIS: inetpub/icon

      ◆ Data source log format and day-based truncation rules
      1. For Apache: Set the log format to combined. to truncate logs, you must install the cronolog tool to truncate logs by day:
        CustomLog "|/usr/local/sbin/cronolog/path/to/apache/logs/access_log. % Y % m % d" combined
        For example: logs/access_log.20030326
        Logs are compressed. You can use gzip-d
      2. For IIS: by default, there are good daily log truncation rules, but the IIS log format is not suitable for AWStats statistics,
        Therefore, it is best to remove all log fields directly and set them strictly according to the following list:
        • Date
        • Time
        • Customer 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)
        • Refer to cs (Referer)
        Compared with the default IIS settings, the following are reduced:
        • Server IP Address
        • Server Port
        • URI query
        Added:
        • Sent bytes
        • Protocol version
        • Reference
      ◆ Configuration file naming rules: awstats. sitename. conf

      AWStats. pl automatically calls the configuration file awstats. sitename. conf of the corresponding Site Based on the site name.
      For example, running./awstats. pl-config = chedong calls the awstats. chedong. conf configuration file in the same directory;
      If-config is not specified, awstats. conf or/etc/awstats. conf in the current directory will be used as the default configuration file.
      So it is best to rename the default awstats. model. conf to awstats. yoursite. conf; for example: awstats. chedong. conf,


      Related Article

      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.