Awstats with Debian Lenny
Based on Debianhelp: Awstats Configuration in Debian
aptitude update aptitude awstats
Run the awstats configure script to setup awstats for the domain you want to monitor.
Remember to repeat the configuration process for each domain you want to monitor.
cd /usr/share/doc/awstats/examples/ /usr/share/doc/awstats/examples$ perl awstats_configure.pl
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 script in /usr/share/doc/awstats/examples/ which is the Debian way.(See the original for detailed script output)
After the script exits, you should set up an alias for awstats-icons in httpd.conf. Inserted it in the Aliases section.
cp /usr/share/doc/awstats/examples/apache.conf /etc/apache2/conf.d/awstatsNow 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_example.com.log”):
/usr/lib/cgi-bin/awstats.pl -config=full-domain-name
Setup a prerotate task to run awstats.pl before log rotate and change permissions of log file to 644.
vim /etc/logrotate.d/apache2prerotate if [ -x /usr/lib/cgi-bin/awstats.pl -a -f /etc/awstats/awstats.example.com.conf -a -r /var/log/apache2/access_example.com.log ]; then /usr/lib/cgi-bin/awstats.pl -config=example.com -update fi endscriptvim /etc/cron.d/awstats
0,10,20,30,40,50 * * * * www-data [ -x /usr/lib/cgi-bin/awstats.pl -a -f /etc/awstats/awstats.example.com.conf -a -r /var/log/apache2/access_example.com.log ] && /usr/lib/cgi-bin/awstats.pl -config=example.com -update 2>&1 >/dev/null
Tagged as: awstats, debian, howto, lenny, notizzettel | Author: Martin Leyrer
[Sonntag, 20110102, 17:36 | permanent link | 0 Kommentar(e)
Comments are closed for this story.