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