Collaborative editing does not work on Windows Service with modified server.xml
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
When starting Confluence as a Windows Service, the Collaborative Editing feature does not work. Editing a page returns the error:
This page is taking longer to load than usual. Give it a few moments, then try refreshing. Still having issues? Contact your Confluence admin.
Diagnosis
The Tomcat
<confluence_install>/conf/server.xml
file has modified values for thedefaultHost
in theEngine
tag andname
for theHost
tag:<Engine name="Standalone" defaultHost="www.myconfluence.com" debug="0"> <Host name="www.myconfluence.com" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false" startStopThreads="4">
The default values for both these fields are normally
defaultHost="localhost"
andname="localhost"
for Engine and Host respectively.- The Synchrony java Service appears to be running. Assuming Synchrony is configured on the default 8091 port:
- Loading http://<synchrony server IP>:8091/synchrony/heartbeat in a Browser returns OK
- Loading <Confluence Base URL>/synchrony-proxy/heartbeat in a Browser returns a HTTP 404 Not Found response
- When running the exact same Confluence instance using
<confluence_install>/bin/start-confluence.bat
instead of as a Windows Service, Collaborative Editing works fine!
Cause
The Engine/defaultHost and Host/name entries are used for Virtual Hosting within Tomcat. Both these entries should be left as the default localhost and is not related to the Base URL that Confluence is being served on.
By changing these from the default localhost values, it appears that Tomcat has not deployed the /sychrony-proxy
off the Base URL of Tomcat when running as a Windows service. Hence, <Confluence Base URL>/synchrony-proxy/heartbeat is returning the HTTP 404 Not Found
Resolution
- Edit the Tomcat <confluence_install>/conf/server.xml file
Revert the Engine/defaultHost to localhost and Host/name to localhost which are the defaults. These values should not be changed and has no relation to the Base URL that Confluence is being served on.
<Engine name="Standalone" defaultHost="localhost" debug="0"> <Host name="localhost" debug="0" appBase="webapps" unpackWARs="true" autoDeploy="false" startStopThreads="4">
- Restart the Confluence Windows Service
- Check that Collaborative Editing now works
Additional Resources
To configure Confluence behind a Reverse Proxy, refer to these articles:
- Proxying Atlassian server applications with Apache HTTP Server
- How to use NGINX to proxy requests for Confluence