Production Deployment

14 views
Skip to first unread message

deezthugs

unread,
Mar 6, 2006, 10:41:06 PM3/6/06
to turbo...@googlegroups.com, cherryp...@googlegroups.com
Hello All:

I am building a TG app and am ready to deploy my "alpha" release for 24x7 use by testers. I have installed lighttpd and all of the WSGI/scgi modules. I am running TG 0.9a1 (release). Everything seems to work great for a few hours, then the Cherrypy server seems to die, and is unresponsive, giving me 500 errors (from lighttpd).

I start the server like this: ./scgi-start.py prodcfg.py &, and do not have an actual start script in init.d yet.

Has anyone else out there had any issues like this with cherrypy behind lighttpd?

I have pasted my config files here:

=================>Here is my production config file:

sqlobject.dburi="mysql://user:passwd@localhost/db"
# SERVER
server.environment="production"
server.log_file="server.log"
server.log_to_screen=False
server.socketPort=2000
server.logFile = '/home/david/tg-log.log'
threadPool = 5
autoreload.package="rcache"
sessionFilter.on = True
sessionFilter.storageType = 'File'
sessionFilter.storagePath = '/tmp'
sessionFilter.storageFileDir = '/tmp'
tg.allow_json = True
path("/static")
staticFilter.on = True
staticFilter.dir = absfile("rcache", "static")

=====================>here is my wsgi server start script:

#!/usr/bin/env python
import pkg_resources
pkg_resources.require("TurboGears")

import cherrypy
import turbogears
from os.path import *
import sys

from cherrypy._cpwsgi       import wsgiApp
from flup.server.scgi_fork  import WSGIServer
from os.path                import *

if len(sys.argv) > 1:
    turbogears.update_config(configfile=sys.argv[1],
        modulename="rcache.config")
elif exists(join(dirname(__file__), "setup.py")):
    turbogears.update_config (configfile="prodcfg.py",
        modulename="rcache.config")
else:
    turbogears.update_config(configfile="prodcfg.py",
        modulename="rcache.config")

from rcache.controllers import Root

cherrypy.root = Root()
cherrypy.server.start(initOnly=True, serverClass=None)
WSGIServer(application=wsgiApp).run()

===============>Here is my lighttpd config:

server.port = 81

server.modules = ( "mod_access",
                   "mod_scgi",
                   "mod_accesslog",
                   "mod_rewrite",
                   "mod_staticfile" )

server.document-root = "/home/david/rcache/production/rcache/rcache"
server.errorlog      = "/tmp/lighttpd.error.log"

accesslog.filename   = "/tmp/access.log"

$HTTP["url"] !~ "^static/" {
  scgi.server = (
                  "/" =>
                    ( "127.0.0.1" =>
                      (
                        "host" => " 127.0.0.1",
                        "port" => 4000,
                        "check-local" => "disable"
                      )
                    )
                )
}

I have spent a lot of time trying to get this to run 24x7 and I must be doing something stupid here. If anyone has any pointers for me or can see an error in my config, please let me know. I have cross-posted to cherrypy-users and turbogears.

Best Regards,

David Dahl

Remi Delon

unread,
Mar 7, 2006, 10:11:01 AM3/7/06
to cherryp...@googlegroups.com

Well, the first thing to find out is whether CherryPy dies on its own (this
can happen for instance if if tries to print something to the console but
there is no console) or whether it's being killed by something else ... (for
instance, Apache can kill its children after a while).

One thing you can do is to try and run your CP server in the console and see
if the problem happens...

Remi.

deez...@gmail.com

unread,
Mar 7, 2006, 2:42:50 PM3/7/06
to cherrypy-users
Ok:

I started my app in a detatched terminal (via gnu screen) Hopefully
this will show me if it is a console printing issue or not.

Thanks!
David

deez...@gmail.com

unread,
Mar 7, 2006, 10:54:55 PM3/7/06
to cherrypy-users
Looks like a console issue. I have had my production server up and
running behind lighttpd for about 10 hours now. Thanks for your help.

David

Reply all
Reply to author
Forward
0 new messages