8.5. Using awstats with Icecast2

This section explains how to configure icecast2 for use with Awstats. This helps administrators better track and tally the number of hist or listeners to their Internet audio stream.

Thanks go out to Rado Ramarotafika <rado@linuxmg.org> for providing these instructions for inclusion on this web page. I have modified the layout slightly to work in this format.

According to the official Awstats homepage:

"AWStats is a short for Advanced Web Statistics. It's a free powerful and featureful tool that generates advanced web (but also ftp or mail) server statistics, graphically. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages. It uses a partial information file to be able to process large log files, often and quickly. It can analyze log files from IIS (W3C log format), Apache log files (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar and most of all web, proxy, wap, streaming servers (and ftp servers or mail logs)."

The instructions provided here were tested on the following machines:

A working example is located at Radio Gasy Linux: http://linuxmg.org/cgi-bin/awstats.pl?config=radio.linuxmg.org

8.5.1. Requirements and Setup

Listing 1: A comparison between icecast log access and apache log access file.

Icecast2 log access:
81.65.29.204 - - [23/Apr/2004:14:48:30 +0200] "GET /linuxmg.ogg HTTP/1.0" 200 6986276 "-" "xmms/1.2.9" 2786

Apache log access files. In my /usr/local/apache/conf/httpd.conf file, I have the following:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog /path/to/apache/log/access.log combined

The actual log access entry appears as the following:

81.65.29.204 - - [26/Apr/2004:18:30:00 +0200] "GET /article.php3?id_article=86 HTTP/1.1" 200 6165 "-"
"Mozilla/5.0 (compatible; Konqueror/3.2; Linux) (KHTML, like Gecko)"

The following applications are required for running awstats with icecast logs.

Here is a listing of all the programs and items needed to actually install awstats and have it record and display your icecast logs.