From 1851d21f78e17e140dd84432e713fe2dc603a646 Mon Sep 17 00:00:00 2001 From: Mario Melara Date: Fri, 28 Aug 2020 10:40:47 -0700 Subject: [PATCH] Add tomcat9 config changes Closes ess-dive/ess-dive-project#153 Upgrades tomcat7 to tomcat9 and includes the required configuration changes needed. The AJP connector had changes made to it since tomcat7 which include allowedRequestAttributesPattern, default address is the loopback address and other changes described here: https://tomcat.apache.org/migration-9.html The changes were made accordingly so that metacat and metacatui can connect with each other as shown in the server.xml.patch file. Use tomcat with jdk8 Metacat has compatability problems with jdk11. It has been suggested by the NCEAS group to downgrade and use Java 8. Add server.xml with configuration changes The configuration changes include some additional parameters to get the AJP connector working in Tomcat 9 since some changes were made. Add patch file for server --- Dockerfile | 2 +- image-server.xml | 60 +++++++++++++++++++++++++++++++------------ server.xml | 66 ++++++++++++++++++++++++++++++++++-------------- server.xml.patch | 38 +++++++++++++++++++--------- 4 files changed, 118 insertions(+), 48 deletions(-) diff --git a/Dockerfile b/Dockerfile index ec4795e..b2cc604 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM tomcat:7.0-jre8 +FROM tomcat:9.0-jdk8 # Debian Tomcat UID ARG METACAT_UID=108 diff --git a/image-server.xml b/image-server.xml index df638a3..d676400 100644 --- a/image-server.xml +++ b/image-server.xml @@ -1,4 +1,4 @@ - + - - @@ -63,10 +61,10 @@ --> - + + + - - + + diff --git a/server.xml b/server.xml index b4324ff..9281e10 100644 --- a/server.xml +++ b/server.xml @@ -1,4 +1,4 @@ - + - - @@ -63,10 +61,10 @@ --> - + + + - - + maxThreads="500" + allowedRequestAttributesPattern=".*" + secretRequired="false"/> - @@ -145,10 +172,11 @@ Note: The pattern used is equivalent to using pattern="common" --> + diff --git a/server.xml.patch b/server.xml.patch index 2467226..e41760b 100644 --- a/server.xml.patch +++ b/server.xml.patch @@ -1,33 +1,47 @@ ---- image-server.xml 2019-05-31 12:43:29.000000000 -0700 -+++ server.xml 2019-05-31 16:11:30.000000000 -0700 -@@ -90,7 +90,13 @@ +--- image-server.xml 2020-09-10 11:49:53.000000000 -0700 ++++ server.xml 2020-09-16 11:08:20.000000000 -0700 +@@ -113,12 +113,18 @@ --> -- -+ +- --> ++ redirectPort="8443" ++ acceptCount="1000" + acceptorThreadCount="2" + connectionTimeout="20000" + maxConnections="10000" + maxPostSize="-1" -+ maxThreads="500" /> - ++ maxThreads="500" ++ allowedRequestAttributesPattern=".*" ++ secretRequired="false"/> + - + + -+ + + pattern="%a %l %u %t "%r" %s %b" />