# HG changeset patch # User Matt Johnston # Date 1433773954 -28800 # Node ID 8ef52f27cf95e124bdf06cd79fae9c4d9bb4b3a1 # Parent 0a1b642e30868f6abc42154aee2e512aa93fe0a3# Parent 3e6f82347eab510c155846fe6e8544b0012ff7c0 merge diff -r 0a1b642e3086 -r 8ef52f27cf95 web/requirements.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/requirements.txt Mon Jun 08 22:32:34 2015 +0800 @@ -0,0 +1,11 @@ +argparse==1.2.1 +gevent==1.0.2 +greenlet==0.4.7 + +# sha256: nkIlLxfR3YnuMXReDE--WIYsJRR-sO9SlcnNm8tOosE +lockfile==0.10.2 + +peep==2.4.1 +python-rrdtool==1.4.7 +uWSGI==2.0.10 +wsgiref==0.1.2 diff -r 0a1b642e3086 -r 8ef52f27cf95 web/templog-uwsgi.ini --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/templog-uwsgi.ini Mon Jun 08 22:32:34 2015 +0800 @@ -0,0 +1,15 @@ +[uwsgi] + +# run with "/path/to/venv/bin/uwsgi --chdir /path/to/web /path/to/web/templog.uwsgi" +# tested with Apache mod_proxy_uwsgi and +# ProxyPass /~matt/t2 uwsgi://127.0.0.1:9090/ + +# future: apache > 2.4.9 could use "socket=uwsgi.sock" and then apache config of +# ProxyPass /templog unix:/path/to/web/uwsgi.sock|uwsgi:// +socket=127.0.0.1:9090 + +wsgi-file=templog.uwsgi +gevent=100 + +# for client certificates. default limit is 4096, not sufficient +buffer-size=20000 diff -r 0a1b642e3086 -r 8ef52f27cf95 web/templog.py --- a/web/templog.py Mon Jun 08 22:29:46 2015 +0800 +++ b/web/templog.py Mon Jun 08 22:32:34 2015 +0800 @@ -178,6 +178,7 @@ def main(): + """ for standalone testing """ #bottle.debug(True) #bottle.run(reloader=True) bottle.run(server='cgi', reloader=True) diff -r 0a1b642e3086 -r 8ef52f27cf95 web/templog.uwsgi --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/templog.uwsgi Mon Jun 08 22:32:34 2015 +0800 @@ -0,0 +1,20 @@ +# see templog-uwsgi.ini for arguments + +from gevent import monkey; monkey.patch_all() + +import os +import sys +import trace +# Change working directory so relative paths (and template lookup) work again +thisdir = os.path.dirname(__file__) +if not thisdir: + thisdir="." +os.chdir(thisdir) +os.environ['LD_LIBRARY_PATH'] = '/home/matt/templog/web' + +# for some reason local imports don't work... +sys.path.append(thisdir) + +import bottle +import templog +application = bottle.default_app()