Commit 1e86b81a81fe22227b9682fbdb2590a39b19570a
1 parent
d74fdaec
Exists in
staging
and in
42 other branches
Guide to setup AWStats for Noosfero
Showing
2 changed files
with
85 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,78 @@ |
| 1 | += AWStats setup for Noosfero | |
| 2 | + | |
| 3 | +AWStats is a free powerful and featureful tool that generates advanced web, | |
| 4 | +streaming, ftp or mail server statistics, graphically. | |
| 5 | + | |
| 6 | +See http://awstats.sourceforge.net/ | |
| 7 | + | |
| 8 | +This guide supposes that the Noosfero server is running GNU/Linux Debian Lenny. | |
| 9 | + | |
| 10 | +1. Install AWStats | |
| 11 | + | |
| 12 | +# apt-get install awstats libgeo-ip-perl | |
| 13 | + | |
| 14 | +2. Basic setup | |
| 15 | + | |
| 16 | +Create AWStats config file: | |
| 17 | + | |
| 18 | + * /etc/awstats/awstats.<domain>.conf | |
| 19 | + | |
| 20 | +Include "/etc/awstats/awstats.conf" | |
| 21 | +Include "/etc/noosfero/awstats-noosfero.conf" | |
| 22 | +SiteDomain="<domain>" | |
| 23 | +HostAliases="<domain-aliases>" | |
| 24 | + | |
| 25 | +<domain> should be the domain used in your Noosfero server (eg.: | |
| 26 | +softwarelivre.org) and the <domain-aliases> should be a list with all aliases | |
| 27 | +that you configured in apache (eg.: www.softwarelivre.org | |
| 28 | +www2.softwarelivre.org etc). | |
| 29 | + | |
| 30 | +This setup is considering that the Noosfero server is running varnish (see | |
| 31 | +INSTALL.varnish) and varnishncsa-vhost [1]. | |
| 32 | + | |
| 33 | +[1] http://gitorious.org/varnisnncsa-vhost | |
| 34 | + | |
| 35 | +3. Running AWStats for first time | |
| 36 | + | |
| 37 | +Run awstats by hand via command line: | |
| 38 | + | |
| 39 | +# /usr/lib/cgi-bin/awstats.pl -config=<domain> | |
| 40 | + | |
| 41 | +You should see something as below as output of this command: | |
| 42 | + | |
| 43 | +# /usr/lib/cgi-bin/awstats.pl -config=softwarelivre.org | |
| 44 | +Create/Update database for config "/etc/awstats/awstats.softwarelivre.org.conf" by AWStats version 6.7 (build 1.892) | |
| 45 | +From data in log file "/var/log/varnish/varnishncsa-vhost.log"... | |
| 46 | +Phase 1 : First bypass old records, searching new record... | |
| 47 | +Searching new records from beginning of log file... | |
| 48 | +Phase 2 : Now process new records (Flush history on disk after 20000 hosts)... | |
| 49 | +Jumped lines in file: 0 | |
| 50 | +Parsed lines in file: 452 | |
| 51 | + Found 0 dropped records, | |
| 52 | + Found 0 corrupted records, | |
| 53 | + Found 0 old records, | |
| 54 | + Found 452 new qualified records. | |
| 55 | + | |
| 56 | +4. Setup frontend | |
| 57 | + | |
| 58 | +You should create a new subdomain to have access to the AWStats, usually | |
| 59 | +something like tools.<domain> (eg.: tools.softwarelivre.org). Don't include | |
| 60 | +this subdomain in HostAliases in the AWStats neither in SiteAlias in the | |
| 61 | +Apache. | |
| 62 | + | |
| 63 | +# cp /usr/share/doc/awstats/examples/apache.conf /etc/apache2/conf.d/awstats.conf | |
| 64 | +# invoke-rc.d apache2 restart | |
| 65 | + | |
| 66 | +ps.: Don't forget to change the port /etc/apache/sites-enabled/000-default to | |
| 67 | +8080. | |
| 68 | + | |
| 69 | +Try: http://tools.<domain>/cgi-bin/awstats.pl?config=<domain> | |
| 70 | +(eg.: http://tools.softwarelivre.org/cgi-bin/awstats.pl?config=softwarelivre.org). | |
| 71 | + | |
| 72 | +5. Schedule AWStats in crontab | |
| 73 | + | |
| 74 | + * /etc/cron.d/awstats | |
| 75 | + | |
| 76 | +0,10,20,30,40,50 * * * * www-data [ -x /usr/lib/cgi-bin/awstats.pl -a -f /etc/awstats/awstats.<domain>.conf -a -r /var/log/apache/access.log ] && /usr/lib/cgi-bin/awstats.pl -config=<domain> -update >/dev/null | |
| 77 | + | |
| 78 | +Done, check the AWStats frontend after one or two days to see if is all going well. | ... | ... |
| ... | ... | @@ -0,0 +1,7 @@ |
| 1 | +# GENERAL | |
| 2 | +LogFile="/var/log/varnish/varnishncsa-vhost.log" | |
| 3 | +LogFormat="%virtualname %host %other %logname %time1 %methodurl %code %bytesd %refererquot %uaquot" | |
| 4 | + | |
| 5 | +# PLUGINS | |
| 6 | +LoadPlugin="tooltips" | |
| 7 | +LoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat" | ... | ... |