changeset 553:d16afb5b5cd9

merge
author Matt Johnston <matt@ucc.asn.au>
date Mon, 08 Jun 2015 22:32:34 +0800
parents 9499bd2f344b (current diff) a335760ad447 (diff)
children 9dea75bd765f
files web/templog.py
diffstat 4 files changed, 47 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /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
--- /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
--- 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)
--- /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()