summaryrefslogtreecommitdiff
path: root/plinth.py
diff options
context:
space:
mode:
authorJames Vasile <james@hackervisions.org>2011-12-16 23:45:23 -0500
committerJames Vasile <james@jamesvasile.com>2012-02-19 15:07:15 -0500
commit96eb193351f4e87c83e921bba3a4a67dd0e20870 (patch)
tree01d88d5e9df447706d9448bd5a75ac97e37726d1 /plinth.py
parentd86de602709556477b87a37e06ac02e36ec04088 (diff)
start second server
Diffstat (limited to 'plinth.py')
-rwxr-xr-xplinth.py36
1 files changed, 34 insertions, 2 deletions
diff --git a/plinth.py b/plinth.py
index f630ccd..7edbf10 100755
--- a/plinth.py
+++ b/plinth.py
@@ -129,11 +129,43 @@ def setup():
cfg.log("Loaded %d page plugins" % len(cfg.page_plugins))
cfg.forms = plugin_mount.FormPlugin.get_plugins()
+ # Add an extra server
+ server = _cpserver.Server()
+ server.socket_host = '127.0.0.1'
+ server.socket_port = 52854
+ server.subscribe()
+
+ # Configure default server
+ cherrypy.config.update({'server.socket_host': '0.0.0.0',
+ 'server.socket_port': cfg.port,
+ 'server.thread_pool':10,
+ 'tools.staticdir.root': cfg.file_root,
+ 'tools.sessions.on':True,
+ 'tools.auth.on':True,
+ 'tools.sessions.storage_type':"file",
+ 'tools.sessions.timeout':90,
+ 'tools.sessions.storage_path':"%s/data/cherrypy_sessions" % cfg.file_root,
+
+ })
+
+ config = {'/': {'tools.staticdir.root': '%s/static' % cfg.file_root},
+ '/static': {'tools.staticdir.on': True,
+ 'tools.staticdir.dir':"."},
+ '/favicon.ico':{'tools.staticfile.on':True,
+ 'tools.staticfile.filename': "%s/static/theme/favicon.ico" % cfg.file_root}
+ }
+ cherrypy.tree.mount(cfg.html_root, '/', config=config)
+
+
+ cherrypy.engine.signal_handler.subscribe()
+
+
def main():
setup()
- cherrypy.quickstart(cfg.html_root, script_name='/', config="cherrypy.config")
-
+ print "localhost %d" % cfg.port
+ cherrypy.engine.start()
+ cherrypy.engine.block()
if __name__ == '__main__':
main()