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 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.


8 thoughts on “The 5 minute guide to setting up TileCache on Windows

  1. 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. here is tilecache 2.04
    I found that line 33 is empty

    # We’d like to let debian install the /etc/tilecache.cfg,
    # but put them in tilecache/tilecache.cfg using setuptools
    # otherwise.
    extra = { }
    if “–debian” in sys.argv:
    extra[‘data_files’]=[(‘/etc’, [’tilecache.cfg’])]
    extra[‘data_files’]=[(‘TileCache’, [’tilecache.cfg’])]

    description=’a web map tile caching system’,

    which line you suppose to modified?

  3. yo no eh podido hecharlo andar pero yo utilizo un servidor IIS y mapserver si pudieran ayudarme porfavor

Comments are closed.