I am running CherryPy for my IIS sites. There are several tricks to make it work.
- When working as an IIS workflow identifier, you will not have the same permissions as when starting a site from a user process. Everything will break. In particular, everything that it wants to write to the file system will probably not work without any configuration.
- If you use setuptools, you probably want to install your components with the -Z option (unpacks all eggs).
- Use win32traceutil to troubleshoot. Make sure on your hook script that you are importing win32traceutil. Then, when you try to access the website, if something goes wrong, make sure that it is printed at the standard level, it will be written to the trace utility. Use "python -m win32traceutil" to see the result of the trace.
It is important to understand the basic process in order to run the ISAPI application. I suggest first getting a WSGI welcome application running under ISAPI_WSGI. Here's an earlier version of the hook script I used to verify that I get CherryPy to work with my web server.
#!python """ Things to remember: easy_install munges permissions on zip eggs. anything that installed in a user folder (ie setup develop) will probably not work. There may still exist an issue with static files. """ import sys import os import isapi_wsgi
This script performs several actions. It (a) acts as an installer, installing itself in IIS [install_virtual_dir], (b) contains the entry point when IIS loads the DLL [__ExtensionFactory__], and (c) creates the CherryPy WSGI instance used by the ISAPI [setup_application] handler.
If you put this in your \ inetpub \ cherrypy directory and run it, it will try to install itself in the root of your IIS website called "CherryPy Web Server".
You can also see my production website code , which reformatted it all into different modules.
source share