List Info

Thread: Production Deployment




Production Deployment
user name
2006-03-07 15:11:01
> 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:passwdlocalhost/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.

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.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )