# HG changeset patch # User Matt Johnston # Date 1433773954 -28800 # Node ID d16afb5b5cd9a30c66a85643a250ab8a1975adf8 # Parent 9499bd2f344b389e7127d3c3dc36f27d4d93132b# Parent a335760ad4471aeb925ec56ba918a9af76c401b9 merge diff -r 9499bd2f344b -r d16afb5b5cd9 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 9499bd2f344b -r d16afb5b5cd9 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 9499bd2f344b -r d16afb5b5cd9 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 9499bd2f344b -r d16afb5b5cd9 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()