2 """Main FastCGI entry point for authenticated web interface"""
7 from main import InvirtWeb
10 base_dir = os.path.dirname(__file__)
13 print >>sys.stderr, """%s [config]
15 Run server as FastCGI, with CherryPy config from "main.conf".
17 With `config`, run standalone with CherryPy config from `config`.
21 if __name__ == "__main__":
25 if sys.argv[1] in ('-h', '--help'):
27 conf_file = sys.argv[1]
30 conf_file = os.path.join(base_dir, 'main.conf')
34 'tools.invirtwebstate.on': True,
38 app = cherrypy.tree.mount(InvirtWeb(),
42 cherrypy.config.update(conf_file)
45 cherrypy.server.quickstart()
46 cherrypy.engine.start()
47 cherrypy.engine.block()
49 cherrypy.engine.start(blocking=False)
50 from flup.server.fcgi import WSGIServer
51 server = WSGIServer(cherrypy.tree)