AWStatic is a front-end for AWStats: it reads AWStats data files and produces a static HTML file that can be accessed offline or served by any HTTP server (without CGI support).
For now, AWStatic is not much more than a small exercise in building a client-side application. It is far from being as complete as the default front-end shipped with AWStats (although it probably is a bit more elegant). It currently includes:
- a full statistics overview with hits, pages, visits, visitors and bandwidth by day, by month and by year;
- top 10 pages (hits and bandwidth) by month and by year;
- top 10 files (hits and bandwidth) by month and by year;
- top 30 referrers (pages and hits) by month and by year;
- top 30 search keywords by month and by year;
- top 30 search phrases by month and by year.
A future version may include diagrams that show the repartition of operating systems and browsers.
As usual, installing in a virtual environment is highly recommended:
$ easy_install https://github.com/dbaty/AWStatic/tarball/master
How to use AWStatic
Once installed, AWStatic provides an
$ awstatic --help usage: awstatic [-h] [-v] [CONFIG_FILE] positional arguments: CONFIG_FILE The configuration file to use. Default is "./awstatic.ini". optional arguments: -h, --help show this help message and exit -v, --version show program's version number and exit
As shown in the help message, AWStatic requires a configuration file. Here is an example:
[awstatic] awstats_dir = /var/lib/awstats out_dir = ./out sites = www.example.com=http://example.com www.anotherexample.com=http://another.example.com pdb = true [logger] level = debug path = -
There are two sections:
logger. In the
awstatic section, you may use the following options:
- Directory where raw AWStats data reside. On Debian, it is
/var/lib/awstatsby default. If you are not sure where those files are located on your system, look for files named
- Directory where AWStatic will write its report.
A list of sites to include in the report. Sites are separated by spaces or newline characters. Each site is defined by an identifier that has been used to generate AWStats data files, followed by an equal sign (
=), followed by the root URL of the site (which will be used by AWStatic to provide fully qualified URLs in the report).
If multiple sites are provided, the report will include data for all sites and the user will have to select the site she is interested in (see the screenshot above). Sites are supposed to be independant and their data are not merged.
- A debugging option, useful only if you feel adventurous and would like to jump in the code when an exception occurs. Default: false.
logger section, you may use the following options:
- The level at which you want to debug. May be
- Path to the log file, or a single dash (
-) if logs should be written to the standard error stream. If given a path, it must be an absolute path. Default:
AWStatic is hosted on GitHub at https://github.com/dbaty/AWStatic. Feel free to provide feedback and report issues or patches there.
AWStatic comes with automated tests that may be run with
uses both Python 2.7 and Python 3.2) or
make test (that uses your
python executable). The latter also opens
awstatic/tests/js/tests.html that contains a test suite for the
AWStatic includes the following libraries:
- jQuery, available under both the GPL and MIT license;
- Flot, available under the MIT license;
- Handlebars, available under the MIT license.
It also includes an extract of Bootstrap, available under the Apache License v2.0.
The loading icon has been generated by http://www.ajaxload.info.
AWStatic is written by Damien Baty and is licensed under the 3-clause BSD license, a copy of which is included in the source.