AWStats is a very concise and powerful statistical tool. It can collect the following information about your site:
I. Traffic, visits, page views, clicks, data traffic, and other data precise to monthly, daily, and hourly data
2. Visitor country, visitor IP address, operating system, browser, etc.
Iii. Robots/spiders statistics
Iv. Spinning customer duration
V. Statistics on different files types
6. pages-URL statistics
7. Other information (search keyword, etc)
Http://awstats.sourceforge.net/AWStats Official Website
Http://www.perl.com/perl Official Website
[Root @ localhost AWStats] # ls
Awstats-7.0.tar.gz perl-5.16.1.tar.gz
Install Perl
AWStats is a Perl-based web log analysis tool. There are many introductions on the Internet. Because it is developed based on Perl, you must first install the Perl environment in either Windows or Linux. Therefore, install Perl first. In fact, you also need an Apache environment, which has been installed in the previous section.
[Root @ localhost AWStats] # tar xvfz perl-5.16.1.tar.gz unzip
[Root @ localhost AWStats] # cd perl-5.16.1 To Go To The Directory
[Root @ localhost perl-5.16.1 # rm-F config. Sh policy. Sh
[Root @ localhost perl-5.16.1] # sh configure-de
[Root @ localhost perl-5.16.1] # Make Compilation
[Root @ localhost perl-5.16.1] # Make Test
[Root @ localhost perl-5.16.1] # make install
Config. Sh policy. Sh is the configuration file used during previous installation. You need to delete it during new installation or upgrade installation.
Sh configure-de install and use the default configuration. Generally, it will be OK.
Make Test: Execute the make command, and then make will execute the specified operation according to the test target rule.
After installation, the Directory of Perl is/usr/local/lib/perl5, And the Perl execution file is in/usr/local/bin.
Install AWStats
Decompress AWStats
[Root @ localhost AWStats] # tar xvfz awstats-6.4.tgz
[Root @ localhost AWStats] # mkdir/etc/AWStats
[Root @ localhost AWStats] # mkdir/var/lib/AWStats
The two directories created above will be used in subsequent configurations. One configuration file is used to store site log analysis and the other is used to store log data information.
[Root @ localhost AWStats] # cp-R./awstats-7.0/usr/local/
-R indicates copying all the items in the directory to the/usr/local/directory.
[Root @ localhost test] # mv awstats-7.0 AWStats to rename, easy to operate.
Configure AWStats
[Root @ localhost tools] # pwd
/Usr/local/AWStats // tools
AWStats has its own configuration tool awstats_configure.pl. First, use VI to open the configure. pl file and check whether the configuration of the Perl runtime environment in the first line is correct.
[Root @ localhost tools] # vi awstats_configure.pl
#! /Usr/bin/perl
.............
[Root @ localhost tools] # pwd
/Usr/local/AWStats/tools
[Root @ localhost tools] # Run the configuration file Perl awstats_configure.pl
Do you want to continue setup from this non standard directory [YN]? Do you want to install the non-standard directory [Y/n ]?.............. File (required if first install) [Y/n]? File (if you need to install it first) [Y/n ]?............ Your web site, virtual server or profile name: Your Website server name or file name> demo ............ directory path to store config file (s) (enter for default): directory path storage configuration file (fill in the default value)>/etc/AWStats ........... then, the two carriage returns are configured.
The awstats_configure.pl tool automatically modifies your Apache configuration. The following information is automatically modified in the httpd. conf file of the Apache configuration file.
[Root @ localhost conf] # pwd
/Usr/local/Apache/Conf
[Root @ localhost conf] # vi httpd. conf
Awstats_configure.pl automatically adds the following content at the bottom of the httpd. conf file:
# Directives to allow use of awstats as a CGI # 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 /"## this is to permit URL access to scripts/files in AWStats directory. #<Directory"/Usr/local/AWStats/wwwroot">Options none AllowOverride none order allow, deny allow from all</Directory>
Awstats_configure.pl will automatically generate the/etc/AWStats. Index. conf file based on your answer (the name of the website to be analyzed) during installation.
[Root @ localhost AWStats] # pwd
/Etc/AWStats
[Root @ localhost AWStats] # ls
AWStats. Index. conf
[Root @ localhost AWStats] # vi AWStats. Index. conf file
... Logfile = "/usr/local/Apache/logs/access_log" changed to Apache log file ....
This completes the installation and configuration of awstats.
Analyze logs
[Root @ localhost cgi-bin] # pwd
/Usr/local/AWStats/wwwroot/cgi-bin
[Root @ localhost cgi-bin] # chmod + x AWStats. pl add executable permissions
[Root @ localhost cgi-bin] # PERL/AWStats. pl-Update-Config = demo
Create/update database for config "/etc/AWStats. index. conf "by AWStats version 7.0 (build 1.971) from data in log file"/usr/local/Apache/logs/access_log "... phase 1: first bypass old records, searching new record... searching New records from beginning of log file... jumped lines in file: 0 parsed lines in file: 3 found 0 dropped records, found 0 comments, found 0 blank records, found 3 too upted records, found 0 old records, found 0 new qualified records.
Enter:
Http: // localhost/AWStats. pl? Config = demo
Then we can see the generated log report.
It may be the same as the following error message, whether you have encountered it or not! :
Not foundThe requested URL/awastats. pl was not found on this server.-----------------------------------------------------------------------------Apache/2.2.3 (centos) server at 192.168.0.105 port 80
The above error has not found the cause, so I found another way to access the log file.
[Root @ localhost cgi-bin] # pwd
/Usr/local/AWStats/wwwroot/cgi-bin
[Root @ localhost cgi-bin] # Perl AWStats. pl-Update-Config = demo-output-staticlinks>/var/www/html/awastats.html
In this way, we save the log file to the Apache server named awastats.html
Enter:
Http: // localhost/awstats.html
You can access log files!