af25d9e0
Aurélio A. Heckert
correct markdown ...
|
1
2
|
AWStats setup for Noosfero
==========================
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
3
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
4
|
AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically.
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
5
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
6
|
See http://awstats.sourceforge.net
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
7
|
|
f4910cba
Joenio Costa
Documenting missi...
|
8
|
This guide supposes that the Noosfero server is running GNU/Linux Debian Squeeze.
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
9
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
10
|
### 1. Install AWStats
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
11
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
12
|
# apt-get install awstats libgeo-ip-perl geoip-database
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
13
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
14
|
### 2. Basic setup
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
15
16
|
Create AWStats config file:
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
17
|
`/etc/awstats/awstats.<domain>.conf`
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
18
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
19
20
21
22
|
Include "/etc/awstats/awstats.conf"
Include "/etc/noosfero/awstats-noosfero.conf"
SiteDomain="<domain>"
HostAliases="<domain-aliases>"
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
23
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
24
|
`<domain>` should be the domain used in your Noosfero server (eg.: `softwarelivre.org`) and the `<domain-aliases>` should be a list with all aliases that you configured in apache (eg.: `www.softwarelivre.org`, `www2.softwarelivre.org`, etc).
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
25
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
26
|
This setup is considering that the Noosfero server is running varnish (see `INSTALL.varnish`) and [varnishncsa-vhost](http://gitorious.org/varnisnncsa-vhost).
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
27
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
28
|
### 3. Running AWStats for the first time
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
29
30
31
|
Run awstats by hand via command line:
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
32
|
# /usr/lib/cgi-bin/awstats.pl -config=<domain>
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
33
34
35
|
You should see something as below as output of this command:
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
36
37
38
39
40
41
42
43
44
45
46
47
|
# /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.
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
48
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
49
|
### 4. Setup frontend
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
50
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
51
|
You should create a new subdomain to have access to the AWStats, usually something like tools.<domain> (eg.: tools.softwarelivre.org). Don't include this subdomain in HostAliases in the AWStats neither in SiteAlias in the Apache.
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
52
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
53
54
|
# cp /usr/share/doc/awstats/examples/apache.conf /etc/apache2/conf.d/awstats.conf
# invoke-rc.d apache2 restart
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
55
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
56
|
ps.: Don't forget to change the port `/etc/apache/sites-enabled/000-default` to `8080`.
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
57
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
58
59
|
Try: `http://tools.<domain>/cgi-bin/awstats.pl?config=<domain>`
(eg.: `http://tools.softwarelivre.org/cgi-bin/awstats.pl?config=softwarelivre.org`).
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
60
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
61
|
### 5. Schedule AWStats in crontab
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
62
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
63
|
`/etc/cron.d/awstats`
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
64
|
|
af25d9e0
Aurélio A. Heckert
correct markdown ...
|
65
|
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
|
1e86b81a
Joenio Costa
Guide to setup AW...
|
66
|
|
645cf773
Daniela Feitosa
Small fix on Inst...
|
67
|
Done, check the AWStats frontend after one or two days to see if everything is working properly.
|