[Tilecache] Tilecache under mod_wsgi

Gissur Þórhallsson gissur at loftmyndir.is
Thu Jan 28 06:25:51 EST 2010


Ok  - I got tilecache working under mod_wsgi 3.0 under apache 2.2.14 on
windows 2003 server.

I ended up downloading paste and adding it explicitly to sys.path at the
beginning of Service.py and it all clicked into place.

Thank you very much manel for your tilecache.wsgi script - it was the thing
I needed the most and would have been hard pressed to create myself easily
(I don't know any python :) )

Kind regards again from Iceland,
Gissur Þórhallson


2010/1/28 Gissur Þórhallsson <gissur at loftmyndir.is>

> Thank you both for your pointers. They were most helpful - at least I'm
> getting errors from python now :)
>
> I'm a bit confused thought - it's complaining that it can't find paste,
> which is understandable, since paste is not installed.
> Do I need paste if I'm running under mod_wsgi? I was under the impression
>  that it was only required for wsgi standalone...
>
> Kind regards from Iceland,
> Gissur
>
> On Thu, Jan 28, 2010 at 10:05 AM, <manel.clos at ajgirona.cat> wrote:
>
>>  Hi Gissur,
>>
>> Here is the tilecache.wsgi script I'm using:
>>
>> # In Apache2's config:
>> #  WSGIScriptAlias /tilecache /data/tilecache/tilecache.wsgi
>>
>> import os, sys
>> tilecachepath, wsgi_file = os.path.split(__file__)
>> if not tilecachepath in sys.path:
>>     sys.path.append(tilecachepath)
>>
>> from TileCache.Service import Service, wsgiHandler
>>
>> cfgfiles = (os.path.join(tilecachepath, "tilecache.cfg"))
>>
>> theService = {}
>> def wsgiApp (environ, start_response):
>>     global theService
>>
>>     cfgs  = cfgfiles
>>     if not theService:
>>         theService = Service.load(cfgs)
>>     return wsgiHandler(environ, start_response, theService)
>>
>> application = wsgiApp
>>
>> The script assumes to be in the tilecache dir, along the tilecache.cfg
>> file.
>>
>> Hope this helps.
>>
>>  ------------------------------
>> *De:* tilecache-bounces at openlayers.org [mailto:
>> tilecache-bounces at openlayers.org] *En nombre de *Gissur Þórhallsson
>> *Enviado el:* jueves, 28 de enero de 2010 4:30
>> *Para:* tilecache at openlayers.org
>> *Asunto:* [Tilecache] Tilecache under mod_wsgi
>>
>> Hello,
>>
>> I'm setting up a tilecache instance and wanted to try using mod_wsgi.
>> The thing is that I'm running python 2.6 and have other things that depend
>> on that version of python otherwise I'd just use mod_python.
>>
>> I've got apache 2.2 running on a windows 2003 server already - and
>> mod_wsgi up and running. I just have no idea how to plug tilecache into
>> that.
>>
>> Has anybody had any experience running tilecache under mod_wsgi? Any
>> pointers?
>>
>> Kind regards from Iceland,
>> Gissur Þórhallsson
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/tilecache/attachments/20100128/9025789c/attachment.html


More information about the Tilecache mailing list