The 5 minute guide to setting up TileCache on Windows

TileCache is a caching layer between OGC WMS services (and other tools that generate map images, like Mapnik) and a web map client like OpenLayers.I found the ‘install guide’ on http://tilecache.org/ just a tad concise so here’s my 5 minute guide to setting it up on a Windows XP box:

Note: If you prefer an IIS setup instead of Apache, try this guide (untested).

  • Make sure IIS is not running, check Computer Management (right click on My Computer –> Manage…) to make sure. If you need IIS on port 80, you need to tweak the Apache config file later on.
  • Install Apache (direct download link) . Check the apache web site for local mirrors and the latest version!
  • Make sure the Apache httpd service is started after installation. Run C:\Program Files\Apache Software Foundation\Apache2.2\bin\ApacheMonitor.exe to make sure.
  • Install Python (direct download link) . Check the python web site for latest version!
  • Install tilecache (direct download link). Check the tilecache website for latest version!
  • untgz tilecache and copy contents of dir TileCache-2.0 into C:\Program Files\Apache Software Foundation\Apache2.2\cgi-bin\. This is probably not secure! Get 7zip if you can’t untgz on your windows box yet.
  • Change path in first line of C:\Program Files\Apache Software Foundation\Apache2.2\cgi-bin\tilecache.cgi to

#!C:/Python25/python.exe -u

  • Copy C:\Program Files\Apache Software Foundation\Apache2.2\cgi-bin\index.html to C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ - this will overwrite the default index.html.
  • Change line 28 in index.html to

layer = new OpenLayers.Layer.WMS( “VMap0″, “/cgi-bin/tilecache.cgi?”, {layers: ‘basic’, format: ‘image/png’ } );

OK, that’s it.Now point your browser to:http://localhost/It will by default get tiles from a generic open WMS and store the cache in c:\tmp\tilecache. You can tweak it all you want now by editing tilecache.cfg.

Tags: , , , ,

4 Responses to “The 5 minute guide to setting up TileCache on Windows”

  1. Steven M. Ottens Says:

    This way you install TileCache as a cgi-bin module, which is significantly slower than the mod_python version. There for you need mod_python and install TileCache’s python scripts in /python25/Lib/site-packages and tweak the apache conf

  2. mvexel Says:

    Steven, I had my doubts about the cgi-bin setup - which is actually described on the tilecache.org website. I tried to stay as close to their own ‘installation guide’ as possible.

    It would be good to do some benchmarking. Good idea for a followup post ;) I found a benchmark result in this posting on the tilecache mailing list: http://openlayers.org/pipermail/tilecache/2007-September/000419.html

  3. TileCache on Windows part 2: mod_python « oegeo Says:

    [...] on Windows part 2: mod_python The 5 minute install guide for TileCache on Windows I wrote last weekend was intended to show how easy it is to get a [...]

  4. Benchmarking TileCache, part 1 « oegeo Says:

    [...] some benchmarking in the wake of my TileCache installation ‘endeavor’ of last week (part 1 - part 2). In a series – well, probably two – articles, I will try to provide some insight into [...]

Leave a Reply