2 """Main FastCGI entry point for web interface"""
7 from main import InvirtWeb, InvirtUnauthWeb
10 base_dir = os.path.dirname(__file__)
12 if __name__=="__main__":
13 static_dir = os.path.join(base_dir, 'static')
16 conf_file = sys.argv[1]
19 conf_file = os.path.join(base_dir, 'main.conf')
20 app = cherrypy.tree.mount(InvirtWeb(),
22 {'/': {'tools.staticdir.root': static_dir,
23 'tools.invirtwebstate.on': True},
24 '/static': {'tools.staticdir.on': True,
25 'tools.staticdir.dir': static_dir}
28 unauthApp = cherrypy.tree.mount(InvirtUnauthWeb(),
30 {'/': {'tools.invirtwebstate.on': True}})
31 unauthApp.merge(conf_file)
32 cherrypy.config.update(conf_file)
35 cherrypy.server.quickstart()
36 cherrypy.engine.start()
37 cherrypy.engine.block()
39 cherrypy.engine.start(blocking=False)
40 from flup.server.fcgi import WSGIServer
41 server = WSGIServer(cherrypy.tree)