Create a Dynamic Tilecache
- 1 Overview
- 2 Step-by-step guide
- 2.1 Step 1 - Download & Extract Tilecache
- 2.2 Step 2 - Install the IIS6 Scripting Tools
- 2.3 Step 3 - Create the Tilecache Web Application
- 2.4 Step 4 - Configure Tilecache Web Application
- 2.5 Step 5 - Create a WMS Base Map
- 2.6 Step 6 - Configure Tilecache to avoid any proxy
- 2.7 Step 7 - Adding watermark to the tiles (optional)
- 2.8 Step 8 - Multiple DNS entries
Overview
The Dynamic Tilecache initially creates Base Map tiles on the fly (i.e. when tiles are requested for the first time). This is slightly slower for the end user when they view an area of the map for the first time as the tiles are being created, but once tiles have been created they are stored in the Tilecache and subsequently served in the same way as a standard Tilecache.
Seeding a Tilecache (via the standard method) can cause long periods of high CPU usage. Depending on your configuration, this prolonged period of high CPU usage can affect the performance of your server and have an impact on your iShare applications and related software.
With this in mind we recommend that our iShare in the Cloud customers create a Dynamic Tilecache for their Base Mapping, but please discuss this with one of the Astun Team via the Support Portal prior to setting this up.
Non iShare in the Cloud customers can use the Dynamic Tilecache too (e.g. to avoid other CPU heavy tasks, such as Workflow, or to avoid server back up times during over night runs). Again please contact the Astun team via the Support Portal for further information.
Source taken from ESDM.
Step-by-step guide
Step 1 - Download & Extract Tilecache
Download the tilecache.zip from http://download.astuntechnology.com/public/tilecache.zip.
Overwrite existing tilecache folder (D:\Astun\Tools\TileCache) with the tilecache folder in the zip file excluding the tilecache.cfg file.
Ensure that your python environment has the pillow library installed
Step 2 - Install the IIS6 Scripting Tools
Now you need to make sure that the IIS 6 Scripting Tools feature is installed. Open Server Manager and select Add roles and features e.g.
Select the Role-based or feature-based installation radio button and click Next.
Select the Select a server from the server pool radio button and click Next.
Expand the Web Server (IIS) > Management Tools > IIS6 Management Compatibility and tick the IIS 6 Scripting Tools entry e.g.
When you tick the box the following dialog will be displayed.
Click Add Features and keep clicking Next until you get to the Confirm installation selections dialog where you click Install.
Step 3 - Create the Tilecache Web Application
Now we will create the Tilecache Web Application.
Open IIS and create an Application Pool called Tilecache e.g.
Select .NET Version 2.0 and click OK e.g.
Right click on the Tilecache Application Pool you have just created and select Advanced Settings... e.g.
Make sure that Enable 32-bit Applications is set to True e.g.
Now you need to create the Tilecache Web Application under the iShare GIS application. Right Click on iShareGISLIVE.Web (or whatever your IShareGIS application is called) and select Add Application... e.g.
Enter the Alias as Tilecache and select the Physical path to the tilecache e.g.
Now click the Select... button to select the Tilecache Application pool e.g.
You should end up with a dialog similar to the following:
Step 4 - Configure Tilecache Web Application
Next we need to configure Anonymous access to the Tilecache application. Select Authentic.. button
Make sure that Anonymous Authentication is Enabled and Windows Authentication is Disabled. Right-click on Anonymous Authentication and select Application pool identity as the Anonymous user identity.
Grant the IIS APPPOOL\TileCache user full control over the TileCache folder in Windows Explorer.
Next you need to configure IIS to allow the application to run Python scripts so click on Handler Mappings.
Select Add Script Map... from the Actions e.g.
Enter the following:
Request path = *.py
Executable = "C:\Python27\python.exe" %s %s
Name = Python27 (or whatever else you like)Click Yes on the message "Do you want to allow this ISAPI extension?".
Next you need to edit the D:\Astun\tools\tilecache\web.config file, in a Text Editor such as Notepad++, for the Python27 Handler. If you don't find a web.config then just create a file with that name and make sure it contains the following:
web.config
<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <handlers> <add name="Python27" path="*.py" verb="*" modules="CgiModule" scriptProcessor=""C:\python27\python.exe" %s %s" resourceType="Unspecified" requireAccess="Execute" allowPathInfo="true" /> </handlers> </system.webServer> </configuration>In your D:\Astun\tools\tilecache folder delete the existing tilecache.py and then copy the tilecache.cgi as tilecache.py. Now you need to edit the tilecache.py in a Text Editor such as Notepad++. Delete the first two lines (see those outlined in red below)
Now change the svc entry to read -
svc = Service.load(["D:\\Astun\\Tools\\TileCache\\tilecache.cfg"])e.g.