AWStats installation tutorial (using AWStats to analyze Apache log statistics site data)

Source: Internet
Author: User
Tags apache log
I. AWStats introduction Awstats is a free Apache log statistics tool. The site information that can be counted is as follows: & amp; nbsp

I. INTRODUCTION to AWStats
Awstats is a free Apache log statistics tool. The site information is as follows:
1. visits, visits, page views, clicks, data traffic, etc.
2. accurate to monthly, daily, and hourly data
3. visitor country
4. visitor IP
5. Robots/Spiders statistics
6. guest duration
7. statistics on different Files types
8. Pages-URL statistics
9. visitor OS browser and other information
10. Other Information (search keyword, etc)
II,: Http://sourceforge.net/projects/awstats/ (personal installed version 7.0)
III. installation tutorial:

Tar-zxvf awstats-7.0.tar.gz
Mv/usr/local/src/awstats-7.0/usr/local/awstats
Cd/awstats/tools/
./Awstats_configure.pl
-----> Check for web server install
Enter full config file path of your Web server.
Example:/etc/httpd. conf
Example:/usr/local/apache2/conf/httpd. conf
Example: c: \ Program files \ apache group \ apache \ conf \ httpd. conf
Config file path ('none' to skip web server setup ):
>/Etc/httpd/conf/httpd. conf // apache configuration file path not configured
-----> Check and complete web server config file '/etc/httpd/conf/httpd. Conf'
Add 'Alias/awstatsclasses "/usr/local/awstats/wwwroot/classes /"'
Add 'Alias/awstatscss "/usr/local/awstats/wwwroot/css /"'
Add 'Alias/awstatsicons "/usr/local/awstats/wwwroot/icon /"'
Add 'scriptalias/awstats/"/usr/local/awstats/wwwroot/cgi-bin /"'
Add' 'Ctive ve
AWStats directives added to Apache config file.
-----> Update model config file '/usr/local/awstats/wwwroot/cgi-bin/awstats. model. Conf'
File awstats. model. conf updated.
-----> Need to create a new config file?
Do you want me to build a new AWStats config/profile
File (required if first install) [y/N]? Y // whether to create a new configuration file, select Y
-----> Define config file name to create
What is the name of your web site or profile analysis?
Example: www.mysite.com
Example: demo
Your web site, virtual server or profile name:
> Www.phpddt.com // Set the domain name to be monitored
-----> Define config file path
In which directory do you plan to store your config file (s )?
Default:/etc/awstats
Directory path to store config file (s) (Enter for default ):
> Enter [press the key] // create the awstats configuration file path. the default path is/etc/awstats. press ENTER.
-----> Add update process inside a scheduler
Sorry, configure. pl does not support automatic add to cron yet.
You can do it manually by adding the following command to your cron:
/Usr/local/awstats/wwwroot/cgi-bin/awstats. pl-update-config = www.phpddt.com
Or if you have several config files and prefer having only one command:
/Usr/local/awstats/tools/awstats_updateall.pl now
Press ENTER to continue... // whether to update with the log file, Press ENTER
 
A simple config file has been created:/etc/awstats/awstats.www.phpddt.com. conf
You shoshould have a look inside to check and change manually main parameters.
You can then manually update your statistics for 'www .phpddt.com 'with command:
> Perl awstats. pl-update-config = www.phpddt.com
You can also read your statistics for 'www .phpddt.com 'with URL:
> Http: // localhost/awstats. pl? Config = www.phpddt.com
IV. Configuration tutorial:

1. configure awstats
LogFile = "/var/log/httpd/phpddt/access_log _ % YYYY-0 _ % MM-0 _ % DD-0.log" // because my logs are saved by day
LogFile = "/var/log/httpd/access_log" // log file storage path
DirData = "/var/lib/awstats" // create the generated data path
Lang = "cn" // Default Language
SkipHosts = "127.0.0.1 REGEX [^ 192 \. 168 \.]" // Local and internal access statistics are not collected.
LevelForWormsDetection = 2 // log level. no warning logs are collected.
2. modify the Apache configuration file (if the above operation has been automatically modified)
Vi/etc/httpd/conf/httpd. conf // add the following content
Alias/awstatsclasses "/usr/local/awstats/wwwroot/classes /"
Alias/awstatscss "/usr/local/awstats/wwwroot/css /"
Alias/awstatsicons "/usr/local/awstats/wwwroot/icon /"
ScriptAlias/awstats/"/usr/local/awstats/wwwroot/cgi-bin /"
4. write an update script
Cd/bin/
Touch awstats. sh
Chmod 755 awstats. sh
Script content:
#! /Bin/bash
/Usr/local/awstats/wwwroot/cgi-bin/awstats. pl-update-config = www.phpddt.com
Run the script:
./Awstats. sh
Execute crontab and update automatically every day:
* 3 *** root/bin/awstats. sh
V. test results:

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.