Installer GeoWebCache pour JMap / Installing GeoWebCache for JMap

Produit concerné / Related product

JMapVersions5.0, 6.0, 7.0


Jump to English version

Il est recommandé d'utiliser le produit GeoWebCache conjointement avec JMap pour accélérer le fonctionnement des applications JMap Web. K2 Geospatial fournit sa propre implémentation de GeoWebCache, plus intégrée à JMap. Vous devez installer GeoWebCache sur un serveur Apache Tomcat (Tomcat version 8.5.35). Il est possible d'utiliser le serveur Tomcat qui est inclus avec JMap Server, ou d'en utiliser un autre. Mais pour des performances optimales, il est recommandé d'installer GeoWebCache sur un serveur différent de celui qui est inclus dans JMap Server.

Guide étape par étape

Pour installer GeoWebCache, suivez les étapes suivantes

  1. Téléchargez le fichier geowebcache.war depuis notre site web, section téléchargements (http://k2geospatial.com/fr/produits/telechargements/).

  2. Si vous installez GeoWebCache dans un serveur Tomcat autre que celui de JMap Server, copiez le fichier geowebcache.war dans le répertoire "webapps" de tomcat.

    Attendez quelque secondes, un répertoire nommé "geowebcache" devrait être généré automatiquement. Si ce n'est pas le cas, redémarrez Tomcat pour que le répertoire soit généré. Si vous utilisez le serveur Tomcat inclus avec JMap Server, copiez le fichier dans JMAP_HOME/applications/deployed et redémarrez JMap Server.

  3. Dans le répertoire généré à l'étape 2, ouvrez le fichier WEB-INF/web.xml avec un éditeur de texte et configurez l'emplacement des fichiers mis en cache. Notez que ce répertoire doit déjà exister. Voir l'exemple suivant :

    <context-param>

    <param-name>GEOWEBCACHE_CACHE_DIR</param-name>

    <param-value>C:\env\cache_GWC3</param-value>

    </context-param>

  4. Si vous installez GeoWebCache dans un serveur Tomcat autre que celui de JMap Server, configurez le CorsFilter pour permettre des origines différentes.

  5. Dans le répertoire généré à l'étape 2, ouvrez le fichier WEB-INF/users.properties avec un éditeur de texte et configurez au moins un compte avec le rôle administrateur. Voir l'exemple suivant :

    user=password,ROLE_ADMINISTRATOR


  6. Ouvrez JMap Admin et allez dans la section Paramètres de JMap Server. Dans la sous-section GeoWebCache, entrez l'URL de GeoWebCache (p. e. http://70.38.39.7:8080/geowebcache) dans le premier champ URL.


  7. Toujours dans la sous-section GeoWebCache, saisissez le nom d'utilisateur et le mot de passe configurés à l'étape 5.

Une fois ces étapes réalisées, JMap devrait être en mesure de communiquer avec GeoWebCache pour l'utiliser comme cache de tuiles.

Notes additionnelles

Si vous utilisez GeoWebCache dans un serveur Tomcat autre que celui de JMap Server, il faudra également modifier le fichier $tomcat_home$/conf/server.xml. Au niveau de la configuration du Connector (~ ligne 71), ajoutez l'attribut: URIEncoding="UTF-8". Voici un exemple de configuration d'un Connector:

<Connector port="8085" protocol="HTTP/1.1"
  connectionTimeout="20000"
  redirectPort="8443"
  URIEncoding="UTF-8" />

À noter aussi que dans la section Paramètres de JMap, le code d'utilisateur à entrer est celui de configuré dans GeoWebCache.  Lors du déploiement d'application, le code d'utilisateur et mot de passe à entrer est celui d'un utilisateur JMap possédant les permissions d'accès aux couches et projet.

Pour plus d'information sur le produit GeoWebCache, consultez ce site web.


English version

It is recommended to use the product GeoWebCache in conjunction with JMap to accelerate the operation of JMap Web and Mobile applications. K2 Geospatial provides its own GeoWebCache implementation, more integrated to JMap. You must install GeoWebCache on Apache Tomcat server (Tomcat version 8.5.35). It is possible to use Tomcat server that is included with JMap Server, or use another one. But for optimal performance, it is recommended to install GeoWebCache in a different server from the one that is included with JMap Server.

Step-by-step guide

Follow the steps to install GeoWebCache:

  1. Download the file geowebcache.war from our website, downloads section (http://k2geospatial.com/products/downloads/).

  2. If you install GeoWebCache in other Tomcat server than JMap Server, copy the file geowebcache.war in "webapps" directory of Tomcat. Wait a few seconds, a directory named "GeoWebCache" should be generated automatically. If it is not the case, restart Tomcat to generate the directory. If you use Tomcat server included with JMap Server, copy the file into JMAP_HOME/applications/deployed and restart JMap Server.

  3. In the directory generated in step 2, open the WEB-INF/web.xml file with a text editor and configure the location of the cached file. Please note that this directory must already exist. See the following example:

    <context-param>
    <param-name>GEOWEBCACHE_CACHE_DIR</param-name>
    <param-value>C:\env\cache_GWC3</param-value>
    </context-param>

  4. If you install GeoWebCache in other Tomcat server than JMap Server, setting up the CorsFilter  to allow diffent origins.

  5. At the directory generated in step 2, open the file WEB-INF/users.properties with a text editor and configure at least one account with administrator role. See the following example:

    user=password,ROLE_ADMINISTRATOR

  6. Open JMap Admin and go to JMap Server Settings section. In the GeoWebCache subsection, enter the URL of GeoWebCache (p. e. http://70.38.39.7:8080/geowebcache) in the first URL field.

  7. Also in the GeoWebCache subsection, enter the user name and password configured in step 5.


Once these steps are completed, JMap should be able to communicate with GeoWebCache to use as cache tiles.

Additional notes

If you use GeoWebCache in a Tomcat server other than JMap Server's, you will also need to modify the $tomcat_home$/conf/server.xml file. In the Connector connfiguration (~ line 71), add the following attribute: URIEncoding="UTF-8". Here's an example of a Connector configuration:

<Connector port="8085" protocol="HTTP/1.1"
  connectionTimeout="20000"
  redirectPort="8443"
  URIEncoding="UTF-8" />

Also please note that when configuring the GeoWebCache username and password in the JMap Server Settings, the username and password are the same as configured in GeoWebCache.  When deploying a JMap web or mobile application, the username is a JMap user with the permissions to access the layers and project which will be used by GeoWebCache to access the layer information.

For more information about GeoWebCache, please visit this website.