general
LINUX – Setting up AWStats in debian etch
AWStats is a free and powerful log analyzer that works as a CGI or from command line.
AWStats is a free software distributed under the GNU General Public License.
We want to have AWStats working with Apache2 logs on Debian Etch.
0) First let’s check Apache2 Log Configuration in virtual host configuration (by default on /etc/apache2/sites-available/)
A commonly used format string to define log format is this one:
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
Add this and definition in your host configuration file and then get it in use with this additional row
CustomLog /var/log/apache2/access.log combined
Save and restart Apache2
# /etc/init.d/apache2 restart
1) Now install AWStats
# apt-get install awstats
2) Configure Apache2 to include AWStats
create a new config file /etc/apache2/awstats.conf with these rows:
Alias /awstats-icon/ “/usr/share/awstats/icon/”
Alias /awstatscss “/usr/share/doc/awstats/examples/css”
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
ScriptAlias /awstats/ /usr/lib/cgi-bin/
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
Now that are settings are defined you need that apache2 is aware of these config by adding this row in the end of /etc/apache2/apache2.conf
Include /etc/apache2/awstats.conf
Apply new configs:
# /etc/init.d/apache2 reload
3) Configure AWStats
Now try to call the URL http://www.yoursite.com/awstats/awstats.pl and you will get this error:
Error: SiteDomain parameter not defined in your config/domain file. You must edit it for using this version of AWStats.
When calling the URL http://www.mysite.org/awstats/awstats.pl, awstats is looking for the configuration file name after your domain name, namely here /etc/awstats/awstats.www.yoursite.com.conf.
Copy the default awstats configuration file
cp /etc/awstats/awstats.conf /etc/awstats/awstats.www.yoursite.com.conf
And edit it checking these rows:
SiteDomain=“yoursite.com”
/access.log ] && /usr/lib/cgi-bin/awstats.pl -config=www.yoursite.com -update >/dev/null
Categories
- AskoziaPBX (6)
- cisco (1)
- Debian Lenny (6)
- general (1)
- Home server (6)
- Linux (6)
- m0n0wall (1)
- switching (1)
- voice (1)
- Voyage Linux (6)
