![]() |
|
|
AWStats Configuration in Debian What is AWStats?AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages. It uses a partial information file to be able to process large log files, often and quickly. It can analyze log files from all major server tools like Apache log files (NCSA combined/XLF/ELF log format or common/CLF log format),WebStar, IIS (W3C log format) and a lot of other web, proxy, wap, streaming servers, mail servers and some ftp servers. Features: A full log analysis enables AWStats to show you the following
information: To use AWStats, you need the following requirements: If not, you can solve this by downloading last Perl version
at ActivePerl
(Win32) or
Perl.com (Unix/Linux/Other). Install AWStats in Debian # apt-get install awstats Run the awstats configure script to setup awstats for the
domain you want to monitor. # cd /usr/share/doc/awstats/examples/ Answer the questions asked by the script in which you will need to know the full configuration file path of your web server(e.g. /etc/apache/httpd.conf), and the name of your domain for which you are setting up awstats( full-domain-name in this article). While running the script it will complain that it is not being run from the default location (/usr/local/awstats). Answer yes to the prompt to run from the non-standard
location as the official Debian package of awstats places The awstats_configure.pl script adds it in the end of httpd.conf - comment/remove it. Your entry for /awstats-icon/ in the Aliases section should look like: Alias /awstats-icon/ /usr/share/awstats/icon/ Now you can restart apache: # /etc/init.d/apache restart Edit the awstats' domain configuration file you just created /etc/awstats/awstats.full-domain-name.conf to have LogFormat=1. Default "LogFormat=4" does not show Browsers, OS, keywords, etc. Do make sure that the parameter SiteDomain has a value of the domain tomonitor. Generate stats the first time by using the following command. (You can allow awstats to read your apache log file by changing permissions. Run "chmod o+r /var/log/apache/access.log"): #/usr/lib/cgi-bin/awstats.pl -config=awstats.full-domain-name.conf You can now check the stats in your browser by point it to http://full-domain-name/cgi-bin/awstats.pl?config=full-domain-name. Set up cron job for awstats as below: 3,33 * * * * www-data [ -x /usr/lib/cgi-bin/awstats.pl -a -f /etc/awstats/awstats.conf -a -r /var/log/apache/access.log ] && /usr/lib/cgi-bin/awstats.pl -config=full-domain-name -update >/dev/null Setup a prerotate task to run awstats.pl before log rotate and change permissions of log file to 644. access.log 644 is basically allowing access to anybody to read the file. /var/log/apache/*.log { |