SRL Stats website and server backend
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


==== SRL Stats ====

SRL Stats System.

The SRL Stats system is a system created solely for the purpose to ``collect''
statistics from scripts written by the SRL Community. Every user can own
multiple scripts at the system and commit statistics to other scripts,
not necessarily his own.

If you want to run the system, you'll need the following components:
    * jinja2
    * sqlalchemy
    * flup (WSGIServer)
    * matplotlib
    * simplejson
    * numpy

The system uses WSGI/FCGI.
I used lighttpd, but apache and other should work fine too. (But I have no 
instructions on how to set it up with apache. If you have done it please send
in contributions to merlijn on

==== Directories ====

My folder setup:

/srv/srlstats/srlstats <-- location of the sources.
/srv/srlstats/web/ <--- location of static files

==== Lighttpd Setup ====

# You'll need a file called 'stats.fcgi' in your docroot and symlink it to the

# Alternatively you can do this with an url rewrite.
$HTTP["host"] == "" {
    # Rewrite to make it pretty. We'll also need a file stats.fcgi
    # to prevent 404s. XXX Ugly hack <--
    url.rewrite-once += (
                    "^(?:(?!.*static.*)).*$" => "stats.fcgi"
    fastcgi.server += ( ".fcgi" =>
      ( "statsfcgi" =>
            "socket"        => "/tmp/stats.sock",
            "docroot"       => "/srv/srlstats/srlstats"

    server.document-root = "/srv/srlstats/web"

==== Website and Database configuration ====

The file contains the base url, you'll want to change this.

Also fill in

dbu = 'statsdbuserhere'
dbpwd = 'somepasshere'
dwh = 'localhost'
dbp = '5432' # postgresql port
dbname = 'statsdbnamehere'

And if you want to use a different database, edit appropriately. (Change
the engine line)

===== Spawn FCGI ====

This is how I used it:
www-data is lighttpd, srlstats is user for srl-stats.

$ spawn-fcgi -U www-data -G www-data -u srlstats -g srlstats -d \
/srv/srlstats/srlstats/ -f /srv/srlstats/srlstats/  -s \