-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
79 lines (58 loc) · 2.11 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
==== SRL Stats ====
SRL Stats System. http://wizzup.org/stats/
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:
Python:
* 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 wizzup.org)
==== 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
# stats.py.
# Alternatively you can do this with an url rewrite.
$HTTP["host"] == "stats.myhost.com" {
# 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 config.py file contains the base url, you'll want to change this.
Also fill in stats_credentials.py:
dbu = 'statsdbuserhere'
dbpwd = 'somepasshere'
dwh = 'localhost'
dbp = '5432' # postgresql port
dbname = 'statsdbnamehere'
And if you want to use a different database, edit sql.py 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/stats.py -s \
/tmp/stats.sock