Confluence Docker image contains a server.xml based on Jira

XMLWordPrintable

    • Severity 3 - Minor

      Issue Summary

      The official Docker image for Confluence contains a server.xml based on Jira.

      Instead, we need to embed the default server.xml that is created from a brand new installation.

      Steps to Reproduce

      1. Create a new Confluence container, using the command from Docker Hub:
        docker run -v /data/your-confluence-home:/var/atlassian/application-data/confluence --name="confluence" -d -p 8090:8090 -p 8091:8091 atlassian/confluence
        
      2. Log into the container and check the file server.xml

      Expected Results

      The image should contain the default server.xml for new Confluence installations. For example, the parameter protocol is org.apache.coyote.http11.Http11NioProtocol

      Default Confluence server.xml
      <Server port="8000" shutdown="SHUTDOWN" debug="0">
          <Service name="Tomcat-Standalone">
              <!--
               ==============================================================================================================
               DEFAULT - Direct connector with no proxy, for unproxied HTTP access to Confluence.
      
               If using a http/https proxy, comment out this connector.
               ==============================================================================================================
              -->
              <Connector port="8090" connectionTimeout="20000" redirectPort="8443"
                         maxThreads="48" minSpareThreads="10"
                         enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
                         protocol="org.apache.coyote.http11.Http11NioProtocol"/>
              <!--
               ==============================================================================================================
               HTTP - Proxying Confluence via Apache or Nginx over HTTP
      
               If you're proxying traffic to Confluence over HTTP, uncomment the connector below and comment out the others.
               Make sure you provide the right information for proxyName and proxyPort.
      
               For more information see:
                  Apache - https://confluence.atlassian.com/x/4xQLM
                  nginx  - https://confluence.atlassian.com/x/TgSvEg
      
               ==============================================================================================================
              -->
      
              <!--
              <Connector port="8090" connectionTimeout="20000" redirectPort="8443"
                         maxThreads="48" minSpareThreads="10"
                         enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
                         protocol="org.apache.coyote.http11.Http11NioProtocol"
                         scheme="http" proxyName="<subdomain>.<domain>.com" proxyPort="80"/>
              -->
      
              <!--
               ==============================================================================================================
               HTTPS - Direct connector with no proxy, for unproxied HTTPS access to Confluence.
      
               For more info see https://confluence.atlassian.com/x/s3UC
               ==============================================================================================================
              -->
      
              <!--
              <Connector port="8443" maxHttpHeaderSize="8192"
                         maxThreads="150" minSpareThreads="25"
                         protocol="org.apache.coyote.http11.Http11Nio2Protocol"
                         enableLookups="false" disableUploadTimeout="true"
                         acceptCount="100" scheme="https" secure="true"
                         clientAuth="false" sslProtocol="TLSv1.2" sslEnabledProtocols="TLSv1.2" SSLEnabled="true"
                         URIEncoding="UTF-8" keystorePass="<MY_CERTIFICATE_PASSWORD>"/>
              -->
      
              <!--
               ==============================================================================================================
               HTTPS - Proxying Confluence via Apache or Nginx over HTTPS
      
               If you're proxying traffic to Confluence over HTTPS, uncomment the connector below and comment out the others.
               Make sure you provide the right information for proxyName and proxyPort.
      
               For more information see:
                  Apache - https://confluence.atlassian.com/x/PTT3MQ
                  nginx  - https://confluence.atlassian.com/x/cNIvMw
               ==============================================================================================================
              -->
      
              <!--
              <Connector port="8090" connectionTimeout="20000" redirectPort="8443"
                         maxThreads="48" minSpareThreads="10"
                         enableLookups="false" acceptCount="10" debug="0" URIEncoding="UTF-8"
                         protocol="org.apache.coyote.http11.Http11NioProtocol"
                         scheme="https" secure="true" proxyName="<subdomain>.<domain>.com" proxyPort="443"/>
              -->
      
              <Engine name="Standalone" defaultHost="localhost" debug="0">
                  <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false" startStopThreads="4">
                      <Context path="" docBase="../confluence" debug="0" reloadable="false" useHttpOnly="true">
                          <!-- Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->
                          <Manager pathname=""/>
                          <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60"/>
      
                          <!-- http://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Access_Log_Valve -->
                          <Valve className="org.apache.catalina.valves.AccessLogValve"
                                 directory="logs"
                                 maxDays="30"
                                 pattern="%t %{X-AUSERNAME}o %I %h %r %s %Dms %b %{Referer}i %{User-Agent}i"
                                 prefix="conf_access_log"
                                 requestAttributesEnabled="true"
                                 rotatable="true"
                                 suffix=".log"
                          />
      
                          <!-- http://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Remote_IP_Valve -->
                          <Valve className="org.apache.catalina.valves.RemoteIpValve" />
                      </Context>
      
                      <Context path="${confluence.context.path}/synchrony-proxy" docBase="../synchrony-proxy" debug="0"
                               reloadable="false" useHttpOnly="true">
                          <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60"/>
                      </Context>
                  </Host>
              </Engine>
          </Service>
      </Server>
      

      Actual Results

      The server.xml is created based on Jira's default file. The protocol is HTTP/1.1 and we also have some parameters that don't make sense to Confluence, like relaxedPathChars and relaxedQueryChars.

      Current server.xml
      <?xml version="1.0" encoding="utf-8"?>
      
      <Server port="8000"
              shutdown="SHUTDOWN">
      
        <Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
        <Listener className="org.apache.catalina.core.AprLifecycleListener"
                  SSLEngine="on"/>
        <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
        <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
        <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
      
        <Service name="Catalina">
      
          <Connector port="8090"
                     maxThreads="100"
                     minSpareThreads="10"
                     connectionTimeout="20000"
                     enableLookups="false"
                     protocol="HTTP/1.1"
                     redirectPort="8443"
                     acceptCount="10"
                     secure="false"
                     scheme="http"
                     proxyName=""
                     proxyPort=""
      
                     relaxedPathChars="[]|"
                     relaxedQueryChars="[]|{}^\`&quot;&lt;&gt;"
                     bindOnInit="false"
                     maxHttpHeaderSize="8192"
                     useBodyEncodingForURI="true"
                     disableUploadTimeout="true" />
      
          <Engine name="Standalone"
                  defaultHost="localhost"
                  debug="0">
            <Host name="localhost"
                  debug="0"
                  appBase="webapps"
                  unpackWARs="true"
                  autoDeploy="false"
                  startStopThreads="4">
              <Context path=""
                       docBase="../confluence"
                       debug="0"
                       reloadable="false"
                       useHttpOnly="true">
                <!-- Logging configuration for Confluence is specified in confluence/WEB-INF/classes/log4j.properties -->
                <Manager pathname=""/>
                <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve"
                       threshold="60"/>
              
              </Context>
      
              <Context path="${confluence.context.path}/synchrony-proxy"
                       docBase="../synchrony-proxy"
                       debug="0"
                       reloadable="false"
                       useHttpOnly="true">
                <Valve className="org.apache.catalina.valves.StuckThreadDetectionValve"
                       threshold="60"/>
              </Context>
            </Host>
          </Engine>
        </Service>
      </Server>
      

      Workaround

      Manually update the server.xml.j2 file to adjust it and restart the Confluence container.

            Assignee:
            Unassigned
            Reporter:
            Leonardo Faganello (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: