Creating a Tomcat tarball

CollectionSpace distributes an Apache Tomcat tarball that contains a version of Tomcat suitable for running the application, with some recommended configuration settings applied.

A new version of the tarball is created for every release of CollectionSpace. The version of Tomcat to use is largely determined by Nuxeo (e.g. 8.5.x for Nuxeo LTS 2017, used in CollectionSpace 8.x).

CollectionSpace Tomcat tarballs reside in S3, at s3://cs-public-shared-files/releases/{release}/cspace-server-{release}.tar.gz (or https://cs-public-shared-files.s3.us-west-2.amazonaws.com/releases/{release}/cspace-server-{release}.tar.gz), where {release} is the CollectionSpace release number.

To create the tarball:

If the desired Tomcat version is the same as the version used in the previous release of CollectionSpace, the previous release tarball can simply be copied and renamed, following the naming convention above.

Otherwise, to create a tarball from the desired version of Tomcat:

  1. Download the core tar.gz binary distribution of the desired version of Tomcat.

  2. Extract the tar.gz.

  3. In the apache-tomcat-{version} directory:

    1. Create the nuxeo-server/plugins directory (this should be empty, it just needs to exist).

    2. Edit conf/server.xml:

      1. Replace references to port 8080 with 8180

      2. Locate the element:

        <Valve className="org.apache.catalina.valves.AccessLogValve" ... />

        and change the value of the pattern attribute to:

        %h %l %{org.collectionspace.authentication.user}r %t &quot;%r&quot; %s %b
  4. Add the following valve element:

    <!-- Replace the apparent client remote IP address and hostname for the request with the IP address list presented by a proxy/load balancer. This is important for getting CORS checks right. --> <Valve className="org.apache.catalina.valves.RemoteIpValve" internalProxies=".*" />
  5. Add bin/setenv.sh, with the contents:

  6. Run chmod 750 bin/setenv.sh

  7. Package the apache-tomcat-{version} directory into a tarball. On Mac, the command is:

    where {release} is the CSpace release, and {version} is the Tomcat version. Note that the --no-xattrs and --no-mac-metadata flags are needed on Mac only, to prevent Mac metadata from polluting the tarball.

  8. Use the AWS CLI or web console to upload the tarball.

Â