# update package lists from the server sudo apt-get update # install Tomcat sudo apt-get install -y tomcat7
This version of the docs is a work in progress. If you don’t see what you are looking for check the legacy wiki. |
This page describes how to run the Repose WAR in a Tomcat container.
Make sure to install the Repose WAR first!
Repose needs two parameters set in order to start with an optional third parameter to set the location of the config directory.
<Context>
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<!-- OPTIONAL: set the location of the config directory -->
<Parameter name="powerapi-config-directory" value="/etc/repose" override="false"/>
<!-- REQUIRED: these must match the values in system-model.cfg.xml -->
<Parameter name="repose-cluster-id" value="repose" override="false"/>
<Parameter name="repose-node-id" value="repose_node1" override="false"/>
</Context>
Alternatively, the web.xml file within the war itself can be modified to include the following:
<context-param>
<param-name>repose-config-directory</param-name>
<param-value>/etc/repose/</param-value>
</context-param>
<context-param>
<param-name>repose-cluster-id</param-name>
<param-value>cluster</param-value>
</context-param>
<context-param>
<param-name>repose-node-id</param-name>
<param-value>node</param-value>
</context-param>
You may want to increase the size of the maximum allowed HTTP header size and number of allowed headers. See Tomcat’s HTTP Connector documentation for more details.
<Connector port="8080"
protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
maxHttpHeaderSize="32768"
maxHeaderCount="2000" />
Repose can use internal dispatch (within the Tomcat container) to access your deployed WARs.
For example, if you had sample.war deployed, you could set the configured root-path to /sample
and then access it as if it was on the root path (e.g., curl localhost:8080 would point to localhost:8080/sample/).
<?xml version="1.0" encoding="UTF-8"?>
<system-model xmlns="http://docs.openrepose.org/repose/system-model/v2.0">
<repose-cluster id="repose">
...
<endpoint id="internal"
root-path="/sample"
default="true"/>
...
</repose-cluster>
</system-model>
You can use curl or HTTPie to send a request to Tomcat.