This page last changed on Oct 18, 2006 by ivan@atlassian.com.

Reasons For Hosting Confluence As A Service

If you are hosting Confluence on a Windows-based server, installation as a Windows Service offers these advantages:

  • Automated Confluence recovery after server restart
  • Improved troubleshooting through logging server output to file

The guide below applies only to Confluence 2.2.0 onwards on Windows. Windows users running older versions should use the Start Confluence automatically on Windows as a Service (Pre 2.2) guide.

Installing Confluence Standalone As A Service

From your Windows-based server running Confluence 2.2 standalone or later:

  1. Open a command prompt in the <CONFLUENCE-INSTALL>/bin directory

  2. Confirm that the JAVA_HOME variable is set to the JDK base directory with the command
    echo %JAVA_HOME%

    Note that any directory in the path with spaces (eg. C:\Program Files must be converted to its eight-character equivalent (eg. C:\Progra~1)

  3. Install the service with default settings with the command
    service.bat install Confluence
  4. In addition, to have the service start automatically when the server starts, run
    tomcat5 //US//Confluence --Startup auto
    
  5. If you have a less than a 512 meg of memory, skip this step. For users with large Confluence installs, you can increase the maximum memory Confluence can use (default will already be 256MB). For example, you can set the maximum memory to 512 megs using
    tomcat5 //US//Confluence --JvmMx 512
    
  6. If you do not have any JVM parameters you pass to your freestanding version of Confluence, you can skip this step. If you do, add them to the service using
    tomcat5 //US//Confluence ++JvmOptions="-Djust.an.example=True"
    
  7. For any further configuration, check out the Tomcat Windows Service How-To guide

  8. Go to Control Panel -> Administrative Tools -> Services -> Apache Tomcat Confluence and right click on Properties to verify the settings are correct

  9. If you wish to run the service a non-administrator user for security, or if you are using network drives for backups, attachments or indexes, you can run the service as another user. To change users, open the Apache Tomcat Confluence properties, go to the "Log On" tab and enter their username and password. Go to Control Panel -> User Accounts and confirm that the user has write permissions for the %CATALINA_HOME%, index and database directories. Note that any network drives must be specified by UNC and not letter mappings (eg. \\backupserver\jira not z:\jira)

    Confluence is now be installed as a service, but will not automatically start up until the next server reboot

  10. Start the Confluence service with the command
    net start Confluence

Controlling Confluence As A Service

The Confluence service can be controlled from the command prompt

  • Stop Confluence with
    net stop Confluence
  • Uninstall the Confluence service with
    service.bat remove Confluence

Troubleshooting Confluence While Running As A Service

When investigating memory issues or bugs, it may be useful to view Confluence's Garbage Collection information. To turn on the verbose garbage collection, use the command

tomcat5 //US//Confluence ++JvmOptions="-Xloggc:<CONFLUENCE-INSTALL>\logs\atlassian-gc.log"

Related Topics

Start Confluence automatically on system startup

When I run tomcat5.exe with any command line or none at all I get the same error reported in the jakarta service log:

[2006-06-01 11:50:24] [81   service.c] [error] Access is denied.
[2006-06-01 11:50:24] [498  prunsrv.c] [error] Unable to open the Service Manager

I have verified JAVA_HOME and CATALINA_HOME are set, using Java 1.4.2_10.  I can actually start the Confluence server using the startup.bat and have verified that is working properly, but I cannot seem to do anything with tomcat5.exe, thus no Windows service.  

 Any ideas?!

Posted by jamezzz at Jun 01, 2006 15:13

Interesting...Atlassian support sent me an Apache bug report that mentioned "similiar" problem that occured when a user updated to Java SDK 1.4.2_08.  So all I did was replace my Java SDK 1.4.2_10 with 1.4.2_05 and it worked!  Apparently, tomcat5.exe and later versions of the Java 1.4.2 SDK have issues.

Posted by jamezzz at Jun 02, 2006 10:54
Document generated by Confluence on Mar 22, 2007 20:59