AWStats analyzes Nginx access logs

Source: Internet
Author: User

AWStats analyzes Nginx access logs

AWStats is a fast-growing Perl-based WEB log analysis tool on Sourceforge.

It can collect the following information about your site:

  • Visits (UV), visits, page views (PV), clicks, data traffic, etc.
  • Accurate to monthly, daily, and hourly data
  • Visitor country
  • Visitor IP
  • Robots/Spiders statistics
  • Guest duration
  • Statistics on different Files types
  • Pages-URL statistics
  • Visitor Operating System Browser and other information
  • Other information (search keyword, etc)

AWStats configuration (Windows + Apache)

In CentOS 6.3, AWStats + GeoIP allows you to view the website Access Locations

Nginx log analysis AWStats + JAWStats installation Configuration

Classic log analysis tool-AWStats

AWStats log system configuration file and error Induction

Use AWStats to analyze website logs-powerful log analysis tools

The following describes how to analyze Nginx logs in AWStats:

1. Configure the nginx log format

Modify the log format of nginx. conf. Otherwise, awstats cannot be analyzed.

Log_format access' $ remote_addr-$ remote_user [$ time_local] "$ request "'

'$ Status $ body_bytes_sent "$ http_referer "'

'"$ Http_user_agent" "$ http_x_forwarded_for "';

Access_log/var/log/nginx/access. log access;

Note that the double quotation marks in the log format cannot be left blank and each parameter is separated by a space. As long as there are slight differences, awstats cannot read logs.

After modification, make nginx repeat the configuration file:

Shell # nginx-t & nginx-s reload

Ii. Automatic nginx log Cutting

Run a shell script to cut nginx logs at every night. The script content is as follows:

#! /Bin/bash

#

# Filename: nginxCutLog. sh

# Author: Qicheng

# Website:

  • 1
  • 2
  • Next Page

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.