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:
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:
If you open it you’ll find a nice tool to edit service 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.
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.
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.
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.
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.