Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Experimental mod_python server for Mapnik #101

Closed
artemp opened this Issue · 10 comments

1 participant

@artemp
Owner

Hi,

I've been working on a mod_python compatible server wrapper for Mapnik: what we've been using in-house is using a PHP script to essentially proxy shelled-out Mapnik output, and we really want to switch to a standard platform with a WMS frontend.

This is a working implementation of a mod_python wrapper, based off of the CGI server code. The readme explains how to set it up locally, and there's a sample of a Apache configuration for this.

@artemp
Owner

[springmeyer] What kind of performance gains are you seeing using this server over the fcgi approach?

@artemp
Owner

[tmcw] I actually haven't thoroughly tested this module vs. fcgi. The main benefit of this driver is the fact that Mapnik could fit nicely into the rest of the mapping software I (and, I'm sure, others) are using - TileCache, FeatureServer, Django, etc., have mod_python as either a provided or a preferred Python environment.

@artemp
Owner

[springmeyer] Hey tmcw, maybe a wiki page explaining the use and possible improvements of this code would be more appropriate than a ticket?

But, if you are proposing that this code be added to enable mod_python support for the OGCServer, providing a patch(diff file) here would be most helpful.

thx!

@artemp
Owner

[tom] Hey, I've made a wiki page: ModServer , and I'll have a patch-version done soon.

@artemp
Owner

[springmeyer] Great!

@artemp
Owner

[tmcw] This is an improved version of the existing modserver.py, which properly handles exceptions and port numbers.

@artemp
Owner

[springmeyer] Cool tmcw. I'm curious if you've run this against mapnik trunk yet?

Also, have you ever used the wsgi wrapper? It will be interesting to benchmark a comparison since many say mod_wsgi can be faster than mod_python for a range of applications.

@artemp
Owner

[springmeyer] tmcw,

I've modified your patch quite a bit, but applied in r910 (Please also note r908 and r909)

Usage for the PYTHONHANDLER script (wms.py) script is now:

{{{
import sys
from mapnik.ogcserver.modserver import ModHandler
sys.path.append(/path/to/map_factory.py')
handler = ModHandler('/path/to/ogcserver.conf')
}}}

And a sample mod_python apache conf would be:

{{{

PythonPath "['/home/dane/projects/ogcserver/'] + sys.path"
AddHandler mod_python .py
PythonHandler wms

}}}

Please give it a rip and let me know if it still works for you.

@artemp
Owner

[springmeyer] Whoops, applied a radically wrong file in r910 - http://trac.mapnik.org/browser/trunk/bindings/python/mapnik/ogcserver/modserver.py?rev=911
for the correct file.

@artemp
Owner

[springmeyer] forgot to close this, as it will be in 0.6.0 release

(still needs docs however)

@artemp artemp closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.