[MapProxy] mapproxy IIS

juergen juergen at netgis.de
Wed Aug 22 06:31:45 PDT 2012


Hi list,

i installed mapproxy under windows in a virtual environment and it works
fine.
In the next step I installed the distribute package with easy install. After
the creation of the yaml files I startet mapproxy with ..\mapproxy-util
serve-develop mapproxy.yaml -b 0.0.0.0:9999 on port 9999 and it works!
Now in the last step I want to deploy mapproxy under IIS port 80.
For that purpose I think installing isapi-wsgi will be the best choice. I
tested the handler with the examples (echo.py etc.) and it works! I only
have to activate the 32bit application setting in IIS, because I'm working
with win7 64bit.
After that I write a config.py:

from mapproxy.wsgiapp import make_wsgi_app
application = make_wsgi_app(r'C:\inetpub\wwwroot\mapproxy\mapproxy.yaml')

import isapi_wsgi
def __ExtensionFactory__():
    return isapi_wsgi.ISAPISimpleHandler(application)

if __name__=='__main__':
	# If run from the command-line, install ourselves.
    from isapi.install import *
    params = ISAPIParameters()
    
    sm = [
        ScriptMapParams(Extension="*", Flags=0)
    ]
    vd = VirtualDirParameters(Name="mapproxy",
                              Description = "mapproxy",
                              ScriptMaps = sm,
                              ScriptMapUpdate = "replace"
                              )
    params.VirtualDirs = [vd]
    HandleCommandLine(params)

and install it with "python config.py"
the response of the shell looks like this:
Configured Virtual Directory: mapproxy
Installation complete.

Everything under IIS looks good. There is an virtual directory and I get
access to the demo page writing "localhost/mapproxy":

Welcome to MapProxy 1.4.0
See all configured layers and services at: demo

However after starting the client mapproxy only produces tile_locks in the
cache directory. I controlled every permission settings in IIS and they will
be ok.
The request header looks like this:

Accept	image/png,image/*;q=0.8,*/*;q=0.5
Accept-Encoding	gzip, deflate
Accept-Language	de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Connection	keep-alive
Host	localhost
Referer
http://localhost/mapproxy/demo/?srs=EPSG%3A31467&format=image%2Fjpeg&wms_lay
er=fnp
User-Agent	Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101
Firefox/14.0.1

but the reply header gives back:
Connection	close
Content-Length	14
Content-Type	text/plain
Date	Wed, 22 Aug 2012 13:07:07 GMT
Server	Microsoft-IIS/7.5
X-Powered-By	Python

here are for comparison the working headers using port 9999:
request:
Accept	image/png,image/*;q=0.8,*/*;q=0.5
Accept-Encoding	gzip, deflate
Accept-Language	de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
Connection	keep-alive
Host	localhost:9999
Referer
http://localhost:9999/demo/?srs=EPSG%3A31467&format=image%2Fjpeg&wms_layer=f
np
User-Agent	Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101
Firefox/14.0.1

reply:
Content-Length	23811
Content-Type	image/jpeg
Date	Wed, 22 Aug 2012 13:12:59 GMT
Server	MapProxy/1.4.0 (Werkzeug based) Python/2.7.3

This is the point, where I need help. Is there someone, who knows about
configuring mapproxy for IIS? Notice, we have running mapproxy under linux
and appache and it's no help to launch a discussion about windows.
Every hint is welcome.

Juergen









More information about the MapProxy mailing list