Server.xml is missing
Asked by Kim yeti:

Hi

I've just successfully installed Confluence with docker, but when I try to access it over the web I get this warning message:

**Tomcat config is incorrect**

The Tomcat server.xml has an incorrect configuration:

**scheme** should be 'https'  
**proxyName** should be 'foo.bar'  
**proxyPort** should be '443'

[Troubleshoot](https://confluence.atlassian.com/confkb/can-t-check-base-url-warning-in-confluence-6-6-or-later-939718433.html)

Okay I follow the troubleshoot link - easy I thought ! But the problem is there is no server.xml file and there is no config folder either. Where do I update the info?

Thank you.


Answers:
author: MatthewGibney
body: I had this problem too, turned our my docker run command wasn't correct. I was not specifying the environment variables correctly.

Here is the run command I used (with URL removed)

```
docker run --env CATALINA_CONNECTOR_PROXYNAME=YOURCONFLUENCEURL --env CATALINA_CONNECTOR_PROXYPORT=443 --env CATALINA_CONNECTOR_SCHEME=https --env CATALINA_CONNECTOR_SECURE=true -v /data/your-confluence-home:/var/atlassian/application-data/confluence --name="confluence" -d -p 8090:8090 -p 8091:8091 atlassian/confluence-server:latest
```

Notice that the environment variables are specified each behind a --env flag.

Hopefully this is useful to anyone else struggling as I was.


author: Nic Brough -Adaptavist-
body: If there's no server.xml or config directory, then we have to question why you (or something on your system) has deleted them, or why your server refused to let the installer create them, while allowing other parts to be created.

What do you have in \<confluence install\> and \<confluence install\>/conf ?

comments: author: Felix_K?ppers
body: Same here, followed the standard procedure of installing the confluence docker image, the whole wiki is installed and connection to db setup and works but the conf folder and server.xml file is missing :(

This is the structure after installation:

![2019-05-22 13:54:54.png](https://community.atlassian.com/t5/image/serverpage/image-id/55398i6864D895FFDF2354/image-size/large?v=v2&px=999 "2019-05-22 13:54:54.png")


author: Nic Brough -Adaptavist-
body: That's the home directory. Try looking in the installation directory.


author: Felix_K?ppers
body: Many thanks [@Nic Brough -Adaptavist-](/t5/user/viewprofilepage/user-id/781454) . this solves it for me, I was looking for this file in the wrong path.

For others, the server.xml in the container lies in:

**/opt/atlassian/confluence/conf/server.xml**


author: cmorgan-be
body: How should this file be preserved across container creation? The data files are preserved as they are in a volume but as /opt/atlassian/confluence/conf is not inside of a volume each time the container is recreated the configuration is lost.

Note that the bitbucket-server configuration file IS inside of the application data folder so it is properly preserved across image upgrades and container creation if you've correctly added a volume for that directory.


author: Matt Cavanagh
body: I too am hitting the issue where the tomcat configuration is being overriden on run time. I suspect this warning is a result of this happening:

confluence \| 02-Sep-2019 18:38:33.469 WARNING \[main\] org.apache.catalina.startup.SetAllPropertiesRule.begin \[SetAllPropertiesRule\]{Server/Service/Connector} Setting property 'proxyPort' to '' did not find a matching property.

After that line is emitted, my config is malformed and changed from what I supply via a docker volume.


author: akraynev_omp
body: Updated to 6.15.9, double-checked properties and still see this warning. Any guesses how to debug?


author: skh397
body: I have already updated server.xml and added env. variable, but I still got error message

**Tomcat config is incorrect**

The Tomcat server.xml has an incorrect configuration:

....

++env. variable++

CONFLUENCE_PROXY_SCHEME - https

CONFLUENCE_PROXY_NAME - subdomain.domain.com

++server.xml++

==============================

\<Connector 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"/\>

==============================

comments: author: Nic Brough -Adaptavist-
body: That section looks ok, your error is somewhere else in the file.


author: skh397
body: Many thanks [@Nic Brough -Adaptavist-](/t5/user/viewprofilepage/user-id/781454)

I updated my server.xml by following steps, am I correct?

1. Download server.xml template file from container "/opt/atlassian/etc/server.xml.j2"

2. Update my mentioned section into server.xml.j2 and upload into container

3. Restart container

4. As checked /opt/atlassian/confluence/conf/server.xml, my updated section exists


author: Nic Brough -Adaptavist-
body: Looks ok. The problem is that your file contains an error.


author: skh397
body: Seems no error in server.xml, because of I downloaded the original file and just updated the values:

scheme="https"  
secure="true"  
proxyName="subdomain.domain.com"  
proxyPort="443"

By the way, I just downloaded log files in Confluence administration \> Troubleshooting and support tools \> Create support zip. I found the above setting have not apply into Confluence_support_2020-05-25-02-19-09\\tomcat-config\\server.xml

Do I need to update server.xml in tomcat too? this file seems different with /opt/atlassian/confluence/conf/server.xml in Confluence


author: Nic Brough -Adaptavist-
body: So your new file copied from the original, no longer has the error in it that is causing "the tomcat configuration is incorrect".

I'm now lost on what you're asking about or what you're doing because you now seem to have a valid file and hence should have a working system.


author: skh397
body: Yes, I have a working system, but keep popup the error message "Tomcat config is incorrect....."

![Error Msg.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/96204i80F511DA6ED115BE/image-size/large?v=v2&px=999 "Error Msg.PNG")

Then, I try to fix this problem by update the server.xml template file and restart container, and confirmed /opt/atlassian/confluence/conf/server.xml have been updated, but the above message still keep to popup

![server_xml2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/96213i705A17B0796FA649/image-size/large?v=v2&px=999 "server_xml2.PNG")

After that, I downloaded log file in Confluence administration \> Troubleshooting and support tools \> Create support zip.

In the downloaded zip file, I found server.xml in "Confluence_support_2020-05-25-07-57-02\\tomcat-config", which is no scheme / proxyName / proxyPort exists

![server_xml.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/96212i7208A9A107E19E80/image-size/large?v=v2&px=999 "server_xml.PNG")


author: Nic Brough -Adaptavist-
body: Right, so this is screaming that you are looking at the wrong server.xml file.

Could you

* Log into Confluence as an admin and go to Admin -\> General Configuration -\> System information
* Find the line that says "catalina.home" and note the value is a directory
* Log into the server and go to the directory
* Descend into "conf" under that
* The server.xml file in here is the one that Confluence is reading (unless you've configured something really unusual). Forget copies or templates, just look at this file.


author: skh397
body: As checked in Admin -\> General Configuration -\> System information

![Confluence_Server_Info.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/96248iAD2CCC4549930D3D/image-size/large?v=v2&px=999 "Confluence_Server_Info.PNG")

After the following step, same error popup

1. Download server.xml file by command:

"docker cp 516deeb60341:/opt/atlassian/confluence/conf/server.xml server.xml"

2. Edit the values for elements secure / scheme / proxyName / proxyPort in Connector section

3. Upload updated server.xml into server by command:

"docker cp server.xml 516deeb60341:/opt/atlassian/confluence/conf/server.xml"

4. Restart container by command: "docker restart 516deeb60341"

Below content is my server.xml downloaded from /opt/atlassian/confluence/conf/server.xml (*proxyName marksed here*)

=====================

\<?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="true"  
scheme="https"  
proxyName="subdomain.domain.com"  
proxyPort="443"

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\>

=====================


author: skh397
body: Problem fixed by add server.xml into config map in Openshift


author: Nic Brough -Adaptavist-
body: So you reverted to a copy of a working file and configured the right one to be deployed? Is that what you mean?


author: skh397
body: I created the config file in Openshift by the content of server.xml, and mount it to "opt/atlassian/confluence/conf/server.xml" with read/write permission


author: Daniel Stoeber
body: Had the same Issue with Container: teamatldocker/confluence:latest

I changed the following ENV with portainer to:
> CONFLUENCE_PROXY_SCHEME - https
>
> CONFLUENCE_PROXY_NAME - \<My URL\>

Issue solved. :)


Tags: confluence-server

reverse-proxy

server