How to run a Cherrpy server as a Windows service

390 views
Skip to first unread message

mpearce

unread,
Dec 29, 2010, 3:27:37 AM12/29/10
to cherrypy-users
Hi,

I'm trying to set up a new Turbogears application (includes cherrypy
web server) on a windows machine. If I use the command prompt window
(dos) to start the server, I need to stay logged in, which is not
preferred. I would like to set up the server to start automaticaly as
a windows service. Has anyone had experience with this. If so, can you
please advise what steps I need to take.

Thanks,
Michael

Michiel Overtoom

unread,
Dec 29, 2010, 5:44:28 AM12/29/10
to cherryp...@googlegroups.com

Have you seen http://tools.cherrypy.org/wiki/WindowsService ?

Greetings,

mpearce

unread,
Dec 29, 2010, 6:31:29 PM12/29/10
to cherrypy-users
Thanks for that Michiel. I have tried the example in your link and got
it working. I now need to make it work with a TurboGears application.
Any hints?

Thanks.

Daniel Dotsenko

unread,
Dec 29, 2010, 6:53:37 PM12/29/10
to cherrypy-users
I remember running into trouble with the instructions from there...
Don't remember exactly what the trouble was, maybe it was my need to
run just the WSGI server component, but I had to tweak the
instructions.

Here is my example of using CherryPy's WSGI Server as Windows Service:

http://gitorious.org/git_http_backend_py/git_http_backend_py/blobs/master/examples/windows_service/git_http_backend_winservice.py

Daniel.

mpearce

unread,
Dec 29, 2010, 7:17:08 PM12/29/10
to cherrypy-users
Thanks Daniel, what is 'git_http_backend'. Is this a module that needs
to be imported? My Turbogears application can be started using a
Paster command from the program directory, however I need to have it
run automatically as a windows service.

Rgds.

On Dec 30, 10:53 am, Daniel Dotsenko <dvdotse...@gmail.com> wrote:
> I remember running into trouble with the instructions from there...
> Don't remember exactly what the trouble was, maybe it was my need to
> run just the WSGI server component, but I had to tweak the
> instructions.
>
> Here is my example of using CherryPy's WSGI Server as Windows Service:
>
> http://gitorious.org/git_http_backend_py/git_http_backend_py/blobs/ma...
>
> Daniel.
>
> On Dec 29, 3:31 pm, mpearce <mgpearc...@gmail.com> wrote:
>
>
>
> > On Dec 29, 9:44 pm, Michiel Overtoom <mot...@xs4all.nl> wrote:
>
> > > On 2010-12-29 09:27, mpearce wrote:
>
> > > > I'm trying to set up a new Turbogears application (includes cherrypy
> > > > web server) on a windows machine. If I use the command prompt window
> > > > (dos) to start the server, I need to stay logged in, which is not
> > > > preferred. I would like to set up the server to start automaticaly as
> > > > a windows service. Has anyone had experience with this. If so, can you
> > > > please advise what steps I need to take.
>
> > > Have you seenhttp://tools.cherrypy.org/wiki/WindowsService?
>
> > > Greetings,
>
> > Thanks for that Michiel. I have tried the example in your link and got
> > it working. I now need to make it work with a TurboGears application.
> > Any hints?
>
> > Thanks.- Hide quoted text -
>
> - Show quoted text -

Daniel Dotsenko

unread,
Dec 30, 2010, 12:03:25 PM12/30/10
to cherrypy-users
git_http_backend is an WSGI-compatible application.

Don't know exactly what server "paster serve" uses, but "paster serve"
is a wrapper for:
- instantiate TurboGears WSGI app class
- feed the WSGI app to some web server.

Replace "git_http_backend" with your turbogears WSGI app.

If code on this page ( http://code.google.com/p/modwsgi/wiki/IntegrationWithPylons
)is applicable to your TurboGears app, then:
- instantiate your TurboGears app:

from paste.deploy import loadapp
application = loadapp('config:/path/to/your/pylons/site/
development.ini')

- that "application" is supposed to be the equivalent to "app" on line
120 in
http://gitorious.org/git_http_backend_py/git_http_backend_py/blobs/master/examples/windows_service/git_http_backend_winservice.py
Reply all
Reply to author
Forward
0 new messages