Deploying CherryPy (daemon)

后端 未结 4 2158
傲寒
傲寒 2020-12-08 15:04

I\'ve followed the basic CherryPy tutorial (http://www.cherrypy.org/wiki/CherryPyTutorial). One thing not discussed is deployment.

How can I launch a CherryPy app a

4条回答
  •  遥遥无期
    2020-12-08 15:42

    There is a Daemonizer plugin for CherryPy included by default which is useful for getting it to start but by far the easiest way for simple cases is to use the cherryd script:

    > cherryd -h
    Usage: cherryd [options]
    
    Options:
      -h, --help            show this help message and exit
      -c CONFIG, --config=CONFIG
                            specify config file(s)
      -d                    run the server as a daemon
      -e ENVIRONMENT, --environment=ENVIRONMENT
                            apply the given config environment
      -f                    start a fastcgi server instead of the default HTTP
                            server
      -s                    start a scgi server instead of the default HTTP server
      -i IMPORTS, --import=IMPORTS
                            specify modules to import
      -p PIDFILE, --pidfile=PIDFILE
                            store the process id in the given file
    

    As far as an init.d script goes I think there are examples that can be Googled.

    And the cherryd is found in your:

    virtualenv/lib/python2.7/site-packages/cherrypy/cherryd

    or in: https://bitbucket.org/cherrypy/cherrypy/src/default/cherrypy/cherryd

提交回复
热议问题