Monday, February 4, 2013

Developing with GeoServer

If you're developing an application which uses GeoServer to provide mapping data then you might end up in a situation where you need to run GeoServer on the same Tomcat instance as your webapp.  Usually this is to do request proxying to the bigger GeoServer host.

In order to set Tomcat up to properly deploy GeoServer you need to make a few modifications if you're running it in Eclipse.

In the Overview page of Tomcat server set the Server Locations to 'Use Tomcat installation'.

Next, extract the geoserver.war file to /tomcat/webapps/geoserver and configure the Tomcat server.xml with the following statement.

            <Host appBase="webapps" autoDeploy="true" name="localhost"
                unpackWARs="true">

  
                <Valve className="org.apache.catalina.valves.AccessLogValve"
                    directory="logs" pattern="%h %l %u %t &quot;%r&quot; %s %b" prefix="localhost_access_log."
                    resolveHosts="false" suffix=".txt" />



                <Context docBase="E:\tomcat\webapps\manager" path="/manager"
                    privileged="true">
                </Context>

                <Context docBase="E:\tomcat\webapps\geoserver" path="/geoserver">
                </Context>


            </Host>

Finally, edit Tomcat start up arguments and add "-XX:MaxPermSize=128m" to the VM arguments.