assigning python isapi-wsgi module to iis 7.5 web sub-application

659 Views Asked by At

I've got a IIS 7.5 web server runnig a python website using the isapi-wsgi module. As the website is bound to port 80 I would rather like the python website to be running under an added application to this website.

The code generating the corresponding isapi module looks like this

import isapi_wsgi

def install_virtual_dir():
    import isapi.install
    params = isapi.install.ISAPIParameters()
    # Setup the virtual directories - this is a list of directories our
    # extension uses - in this case only 1.
    # Each extension has a "script map" - this is the mapping of ISAPI
    # extensions.
    sm = [isapi.install.ScriptMapParams(Extension="*", Flags=0)]
    vd = isapi.install.VirtualDirParameters(
        Server="dsh",
        Name=site_root,
        Description="CherryPy Application Stable",
        ScriptMaps=sm,
        ScriptMapUpdate="end",
        )
    params.VirtualDirs = [vd]
    isapi.install.HandleCommandLine(params)


if __name__ == '__main__':
    # If run from the command-line, install ourselves.
    install_virtual_dir()

Unfortunately the module is unable to register the corresponding dll resulting in the error

ItemNotFound: No web sites match the description 'dsh'

although I've added the application 'dsh' to the Website. Something like 'Website/dsh' doesn't work either.

Does anybody have encountered the same problem and has a solution for that?

1

There are 1 best solutions below

0
On

If somebody encounters the same problem, I never solved the problem, I did only find a work around, which is to simply commenting and thus not to using the line

 params.VirtualDirs = [vd]

Instead manually add the resulting dll to the Handler Mapping within IIS.