I. Introduction of Awstats
Awstats is a free, very concise and powerful website log analysis tool. It can count the following information about your site:
One: Traffic, number of visits, page views, clicks, data traffic, etc.
Second: Accurate to monthly, daily, hourly data
Three: Visitor Country
IV: Visitor IP
V: Statistics of robots/spiders
VI: Visitor Duration
VII: Statistics on different files type
VIII: Statistics of Pages-url
IX: Guest operating system browser and other information
Ten: Other information (search keywords, etc.)
Second, installation Awstats
1. Preparation before installation
Awstats has a lot of Perl scripts that need Perl support to execute these scripts, so install Perl first
# yum-y Install Perl
2. Start the installation of Awstats
The latest version is 7.0
http://sourceforge.net/projects/awstats/files/AWStats/
You can find the file in the URL above.
# Tar XF awstats-7.0.tar.gz
# MV Awstats-7.0/usr/local/awstats
# Cd/usr/local/awstats
# chmod +x/usr/local/awstats/tools/*.pl
# chmod +x wwwroot/cgi-bin/*.pl
# tools/awstats_configure.pl
Start the installation configuration
Default profile in/etc/awstats/awststs.domain-name.conf
# vim/etc/awstats/awstats.www.domain.com.conf
Need to modify LogFile, that is, the location of your log files
Logfile= "/var/log/nginx/%yyyy-24/%mm-24/access_%yyyy-24%mm-24%dd-24.log"
Logformat=1
Log format, this must match the log format to be analyzed, or the data may not be analyzed or analyzed the incorrect data
Logseparator= ""
Specifies the separator for the log
Sitedomain= "Www.domain.com"
Site domain name to analyze
Dirdata= "/opt/awstats"
Where the parsed data file exists
Iii. using Awstats to analyze logs
Use the following command to genetic awstats data to provide Web Access.
#/usr/bin/perl/var/www/html/awstats/wwwroot/cgi-bin/awstats.pl-config=www.domain.com-update
Iv. Follow-up questions
If you need to automate the above commands every day, you can join crontab
# CRONTAB-E
XX * * */usr/bin/perl/var/www/html/awstats/wwwroot/cgi-bin/awstats.pl-config=www.domain.com-update &>/dev /null
v. Visit
Http://youdomain/awstats/atstats.pl?config=www.mingdao.com
If you are using Apache to provide the web, then in the installation, one step is to let you choose your Apache configuration file location, Awstats will automatically add the relevant configuration to the Apache configuration file
If not specified, add the following manually, or add a virtual host yourself
# vim/etc/httpd/conf/httpd.conf
Add the following configuration
Alias/awstatsclasses "/var/www/html/awstats/wwwroot/classes/"
Alias/awstatscss "/var/www/html/awstats/wwwroot/css/"
Alias/awstatsicons "/var/www/html/awstats/wwwroot/icon/"
scriptalias/awstats/"/var/www/html/awstats/wwwroot/cgi-bin/"
#
# This is the to permit URL for access to Scripts/files in AWStats directory.
#
<directory "/var/www/html/awstats/wwwroot" >
Options None
AllowOverride None
Order Allow,deny
Allow from all
</Directory>
# service HTTPD Reload
Reload the Apache configuration file
If you need to do user Login control for Awstats, you can use Apache's Basic authentication Mode
# Htpasswd-cm/var/www/html/awstats/htpasswd.user Admin
Enter the password two times to
# vim/etc/httpd/conf/httpd.conf
Add the following
<files "awstats.pl" >
AuthName "Mingdao Awstats"
AuthType Basic
Authuserfile/var/www/html/awstats/htpasswd.user
Require User admin
</Files>
# service HTTPD Reload
Reload the Apache configuration file
Installation and configuration of the Awstats