= DEPRECATED = This document is deprecated, please see http://geowebcache.org/docs/1.2.0 = Installing !GeoWebCache = [wiki:de/configuration de] == Foreword == Two editions of !GeoWebCache exist: * Standalone version, which you can download from this page. It can be used with any WMS 1.1.x compliant server. This page mainly concerns itself with this version. * !GeoWebCache is included with GeoServer 1.7.1a and greater. This version is just slightly easier to use with !GeoServer, and reduces memory footprint somewhat. Note that you may add $GEOSERVER_DATA_DIR/gwc/geowebcache.xml to gain the same flexibility as described below. See http://geoserver.org for details. == Standalone == The standalone version of !GeoWebCache is distributed as a .war (Web ARchive) file made for J2EE containers such as Tomcat or JBoss. It is built using Sun Java 1.5, but best performance is achieved by using a Sun Java 1.6 JRE. I have written up some tips regarding [wiki:JavaOnLinux Java and Tomcat on Linux] that you may find helpful. In Tomcat you can upload the .war through the Tomcat Manager interface, http://localhost:8080/manager/html , and it should start automatically. Alternatively the file (which is a regular .zip file) can be unpacked in a new directory and then moved to the webapps directory. See the documentation of your container for details. If you have the build environment (Maven and Java Developer Kit), you can start an instance of Jetty by running {{{mvn install jetty:run}}} To get a quick overview of the data that has been configured, and what services are offered, you should point your browser to http://localhost:8080/geowebcache/demo = Configuring !GeoWebCache = == Overview == There are three components to configuring !GeoWebCache. The paths below assume that the .war file has been unpacked by the servlet container (Jetty, Tomcat or JBoss). * WEB-INF/web.xml * This is the configuration for the servlet. It does very little, but you can define where GWC should store its cache. * WEB-INF/geowebcache-servlet.xml * This file is used by the Spring framework to take Java classes and create the application you know as GWC. The main thing you may want to change in here is where GWC looks for a configuration file, or tell it to configure itself automatically from a WMS capabilities document. In the future you will also be able to add new services by defining them as beans. * WEB-INF/classes/geowebcache.xml * This is the main configuration file for manually defined layers. If you are coming from !TileCache, this is probably where you want to start looking. * WEB-INF/users.properties * This file controls who is allowed to [http://geowebcache.org/trac/wiki/seeding seed] and use the RESTful interface. You put one user per line, the format is: {{{ username=password,ROLE_ADMINISTRATOR }}} == web.xml == You can optionally define where GWC should store the cache for the layers where this is not explicitly defined. For example {{{ GEOWEBCACHE_CACHE_DIR C:/geowebcache }}} As of GeoWebCache 1.1.3 you can also define GWC_BLANK_TILE_PATH , which should be a PNG file that is rendered when a request for a tile is out of bounds. It is also possible to define GWC_METASTORE_DISABLED as TRUE. This will disable the H2 datastore, which can be be handy if you run multiple GWC instances against the same directory. However, this will also disable modifiable parameters and future improvements. == geowebcache-servlet.xml == Please see comments in the file. Where you see {{{...}}} it is possible to pass in several variables. Pay close attention to the log if you make changes to this file, both during startup and the first few requests. If you like, you can have !GeoWebCache attempt to configure itself automatically against a WMS !GetCapabilities document. The downside is reduced control, every layer will be made available in EPSG:4326 and EPSG:900913. To do this, open geowebcache-servlet.xml and change the following: 1) Open WEB-INF/geowebcache-servlet.xml and look for an XML element with id="gwcWMSConfig". This bean has five constructor arguments, note that all & characters must be rewritten as & * The cache factory. Do not change it. * The URL to a valid WMS 1.1.0 getcapabilities document. This is the one you want to change. Note that * The supported formats. You can change this if you like. * The metatiling factor. You may want to increase this to 4x4. * Any additional parameters you want to be sent with every request. For example format_options=regionate_by:auto&bgcolor=0x112233 * Whether to allow uncached connections to the backend. 2) Restart !GeoWebCache , and go to http://localhost:8080/geowebcache/demo to verify that the layers have been loaded. Check the logs of your container, like catalina.out, if they do not show up. == geowebcache.xml == This is the file where you can manually configure layers. It is a commented XML file, please open it in your favorite texteditor and follow along. If you would like to add a new layer, I recommend you copy one of the sample ones and modify it. We were hoping to have a nice AJAX based configuration system ready for 1.0, but we don't and we think you'll manage just fine. Note that you can use an XML editor like jEdit or the plug-in for Eclipse to automatically check the online XSD and catch mistakes. The most up to date documentation is the one [http://geowebcache.org/schema/docs/ automatically generated from the schema]. Basic structure of the file, there are currently no server wide settings in this file: {{{ 1.1.5 120 false ... definition of layer 1 ... ... definition of layer 2 ... }}} The following is a minimal definition of a layer. This will support EPSG:4326 and EPSG:900913, for PNG and JPEG: {{{ some:layer http://sigma.openplans.org/geoserver/wms topp:states }}} However, in most cases you will also want to define the grid: {{{ some:layer 2163 2163 -2495667.977678598 -2223677.196231552 3291070.6104286816 959189.3312465074 -2495667.977678598 -2223677.196231552 3291070.6104286816 959189.3312465074 0 25 http://sigma.openplans.org/geoserver/wms topp:states }}} You can also replace {{{...}}} with something like {{{ 15000.0 12000.0 4000.0 }}} to support specific resolutions. A resolution is defined as coordinate system unites / pixel. So if the tile is 180 degrees wide, and the width of the tile is 256 pixels, the resolution is 180.0 / 256 = 0.703125. Note that these are also supported by the demos, but the OpenLayers client may require you to zoom in and out before it actually picks up on these settings. The following is an extensive definition of a layer: {{{ some:layer image/png image/jpeg image/jpeg image/png false 0xDDDDDD webSafePalette 1.0 2163 2163 -2495667.977678598 -2223677.196231552 3291070.6104286816 959189.3312465074 -2495667.977678598 -2223677.196231552 3291070.6104286816 959189.3312465074 0 25 http://sigma.openplans.org/geoserver/wms http://atlas.openplans.org/geoserver/wms topp:states polygon 3 3 false true 0x112233 test_palette foobar1=TRUE&foobar2=FALSE 240 235 false }}} See the default [http://geowebcache.org/trac/browser/trunk/geowebcache/src/main/resources/geowebcache.xml geowebcache.xml] for further examples. = Logging = This section is currently undocumented, see log4j.properties or ask for help on the mailing list.