Another Stranger Me

my comments, my projects, my resources…

Alfresco – Tomcat as a Windows service

Question that is often asked and that usually leaves new users puzzled is how to run Alfresco on Apache Tomcat 6 as a Windows service. Unlike most examples found on the Internet I’ll show you how to mostly use graphical interface instead of command line. This article assumes you have Alfresco Tomcat bundle extracted at C:\Alfresco and Java 6 installed at default location.

So, to begin, fire-up command prompt and enter these two commands:

cd C:\Alfresco\tomcat\bin
tomcat6 //IS//alfresco –DisplayName=”Alfresco Server” –Install=”C:\Alfresco\tomcat\bin\tomcat6.exe”

We’re done with command line.

What you want to do next is create a shortcut in a convenient location, say desktop and put the following as the shortcut target:

C:\Alfresco\tomcat\bin\tomcat6w.exe //ES//alfresco

If you open it you’ll find a nice tool to edit service settings.

Tomcat server service control general settings

Tomcat server service control general settings

In general setting panel you can modify the service startup type. Next panel is the Log On account for the service. For the simplicity of this article we’ll leave it on Local System account but in production you should use an account with lower privileges.

tomcat service control log on properties

Tomcat server service control log on properties

Next one is the logging panel. You can set the paths as shown in image. Make a mental note that stdout.log is now the main output log instead of alfresco.log. Make another mental note that stdout.log is not rotated daily when you run Tomcat as a service so it can grow huge.

Tomcat server service control logging properties

Tomcat server service control logging properties

Next tab is the most important one – tab where you set all the Java options for the JVM. Make sure you have the paths to jvm.dll and bootstrap.jar correct. Initial memory pool, maximum memory pool, thread stack size are Xms, Xmx, and Xss parameters respectively that you set in alfresco.bat if you use default console startup of Tomcat. I’ll speak more about these parameters in another post.

Tomcat server service control java properties

Tomcat server service control java properties

Final two tabs are pretty much the same and they manage startup and shutdown parameters of the service. Make sure they look as in images.

Tomcat server service startup properties

Tomcat server service startup properties

Tomcat server service shutdown properties

Tomcat server service shutdown properties

64-bit Windows considerations

If you are using 64-bit Windows you’ll likely have trouble installing service using the default tomcat6.exe. Instead, download the 64-bit version from SVN repository. Also, make sure you are using the 64-bit Java.

8 Comments

  1. muoto good
    You’re the guy ..
    Do not ever stop …. ok
    Thanks
    A hug from Brazil ..
    William Silva

  2. Thanks Ivan, this makes live more simple.

    I’m trying to install alfresco / tomcat as a service on windows7, but it won’t start
    I have no real tomcat / java experience and I’m not sure which java options to set.
    The Xms, Xmx, and Xss parameters are not the problem but what about the other Java options?

  3. I suggest that you take a look at alfresco.bat as a good starting point. You’ll see inside how they collect various java options into JAVA_OPTS variable. So just copy whatever they have into Java options area shown in the above picture except Xms, Xmx, and Xss parameters which have separate boxes.

    Some sample would be although it’s fairly basic:
    -Dcatalina.base=C:\Alfresco\tomcat
    -Dcatalina.home=C:\Alfresco\tomcat
    -Djava.endorsed.dirs=C:\Alfresco\tomcat\endorsed
    -Djava.io.tmpdir=C:\Alfresco\tomcat\temp
    -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
    -Djava.util.logging.config.file=C:\Alfresco\tomcat\conf\logging.properties
    -XX:MaxPermSize=256m

    When you later optimize JVM those options would go in the same box.

  4. Hi thanq for nice documentation.I tried the same as instructed but the service is not starting.when i press start it is saying starting service and nothing is happening.Nothing is writing to log also.

  5. Try to run it with default alfresco settings, especially minimum memory sizes, and then fine tune it once you get it to run.

  6. Hi thank you for reply.I tried to run with default settings.still i am getting below error.
    started

    [2010-04-12 18:15:20] [info] Running Service…
    [2010-04-12 18:15:20] [info] Starting service…
    [2010-04-12 18:15:20] [395 javajni.c] [error] CreateJavaVM Failed
    [2010-04-12 18:15:20] [1000 prunsrv.c] [error] Failed initializing java C:\Alfresco\tomcat\bin\bootstrap.jar
    [2010-04-12 18:15:20] [1269 prunsrv.c] [error] ServiceStart returned 2
    [2010-04-12 18:15:20] [info] Run service finished.
    [2010-04-12 18:15:20] [info] Procrun finished.

  7. Are you using 32 or 64 bit platform? Can you post exact OS, Java versions…

  8. I am using 32bit windows xp.Alfresco is installed in C:\Alfresco and java is in
    C:\Program Files\Java\jdk1.6.0_16.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© 2025 Another Stranger Me

Theme by Anders NorenUp ↑