From 1e86b81a81fe22227b9682fbdb2590a39b19570a Mon Sep 17 00:00:00 2001 From: Joenio Costa Date: Wed, 21 Dec 2011 12:42:24 -0200 Subject: [PATCH] Guide to setup AWStats for Noosfero --- INSTALL.awstats | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ etc/awstats-noosfero.conf | 7 +++++++ 2 files changed, 85 insertions(+), 0 deletions(-) create mode 100644 INSTALL.awstats create mode 100644 etc/awstats-noosfero.conf diff --git a/INSTALL.awstats b/INSTALL.awstats new file mode 100644 index 0000000..16b3cff --- /dev/null +++ b/INSTALL.awstats @@ -0,0 +1,78 @@ += AWStats setup for Noosfero + +AWStats is a free powerful and featureful tool that generates advanced web, +streaming, ftp or mail server statistics, graphically. + +See http://awstats.sourceforge.net/ + +This guide supposes that the Noosfero server is running GNU/Linux Debian Lenny. + +1. Install AWStats + +# apt-get install awstats libgeo-ip-perl + +2. Basic setup + +Create AWStats config file: + + * /etc/awstats/awstats..conf + +Include "/etc/awstats/awstats.conf" +Include "/etc/noosfero/awstats-noosfero.conf" +SiteDomain="" +HostAliases="" + + should be the domain used in your Noosfero server (eg.: +softwarelivre.org) and the should be a list with all aliases +that you configured in apache (eg.: www.softwarelivre.org +www2.softwarelivre.org etc). + +This setup is considering that the Noosfero server is running varnish (see +INSTALL.varnish) and varnishncsa-vhost [1]. + +[1] http://gitorious.org/varnisnncsa-vhost + +3. Running AWStats for first time + +Run awstats by hand via command line: + +# /usr/lib/cgi-bin/awstats.pl -config= + +You should see something as below as output of this command: + +# /usr/lib/cgi-bin/awstats.pl -config=softwarelivre.org +Create/Update database for config "/etc/awstats/awstats.softwarelivre.org.conf" by AWStats version 6.7 (build 1.892) +From data in log file "/var/log/varnish/varnishncsa-vhost.log"... +Phase 1 : First bypass old records, searching new record... +Searching new records from beginning of log file... +Phase 2 : Now process new records (Flush history on disk after 20000 hosts)... +Jumped lines in file: 0 +Parsed lines in file: 452 + Found 0 dropped records, + Found 0 corrupted records, + Found 0 old records, + Found 452 new qualified records. + +4. Setup frontend + +You should create a new subdomain to have access to the AWStats, usually +something like tools. (eg.: tools.softwarelivre.org). Don't include +this subdomain in HostAliases in the AWStats neither in SiteAlias in the +Apache. + +# cp /usr/share/doc/awstats/examples/apache.conf /etc/apache2/conf.d/awstats.conf +# invoke-rc.d apache2 restart + +ps.: Don't forget to change the port /etc/apache/sites-enabled/000-default to +8080. + +Try: http://tools./cgi-bin/awstats.pl?config= +(eg.: http://tools.softwarelivre.org/cgi-bin/awstats.pl?config=softwarelivre.org). + +5. Schedule AWStats in crontab + + * /etc/cron.d/awstats + +0,10,20,30,40,50 * * * * 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= -update >/dev/null + +Done, check the AWStats frontend after one or two days to see if is all going well. diff --git a/etc/awstats-noosfero.conf b/etc/awstats-noosfero.conf new file mode 100644 index 0000000..096c3bd --- /dev/null +++ b/etc/awstats-noosfero.conf @@ -0,0 +1,7 @@ +# GENERAL +LogFile="/var/log/varnish/varnishncsa-vhost.log" +LogFormat="%virtualname %host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot" + +# PLUGINS +LoadPlugin="tooltips" +LoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat" -- libgit2 0.21.2