Tomcat Windows Service (2.x)

You can convert the .zip install into a service install by running service.bat from the /bin directory:

C:\tomcat\bin> service.bat install

You can add a service name as a second argument to the above script (the default name is "Tomcat5"). You can uninstall the service by replacing "install" with "remove".

After this you need to set the default startup options:

C:\tomcat\bin> tomcat5 //US//Tomcat5 ++JvmOptions "-Xms512m;-Xmx1024m;-XX:PermSize=128m;-XX:MaxPermSize=256m;-Dfile.encoding=UTF-8; -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false"

If you choose to do this in the GUI follow these steps: Open the configuration window, issue the following command:

C:\tomcat\bin> tomcat5w //ES//Tomcat5

Replace "Tomcat5" with whatever service name you chose for the install. You'll want to set the service to startup automatically ("Startup Type" under the General tab).

Windows users that have installed Tomcat as a service can set most Java options through the Tomcat service manager GUI, but not all of them are as straightforward as inclusion in a single environment variable. To achieve the equivalent of the "-server" option, you'll need to change the Java Virtual Machine path from ..\bin\client\jvm.dll to ..\bin\server\jvm.dll.

(minus) Java 1.6 users will you need add the system property -Dsun.lang.ClassLoader.allowArraySyntax=true. This option is not required for Java 1.5. Please see the Java section above or SAK-15874 for more details.

Be sure to put the remaining JAVA_OPTS on separate lines in the Java Options field of the GUI, e.g.:

-Xms512m
-Xmx1024m
-XX:PermSize=128m
-XX:MaxPermSize=256m
-Dfile.encoding=UTF-8
-Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false
-Dsun.lang.ClassLoader.allowArraySyntax=true
-Dhttp.agent=Sakai

(warning) Samoo has reported that display issues after editing text documents with accented characters using the resources tool. The issue was resolved by adding -Dfile.encoding=UTF-8 as a Java option (open command window -> type "tomcat5w" -> "Java" ->"Java Options:").

You can add additional system properties if needed, e.g., -Dsakai.security=C:\tomcat\security.

Finally, clear out the Initial Memory Pool and Maximum Memory Pool values, as those might conflict with the options you're putting in the Java Options field. Then click Apply, restart the service, and double-check the service manager to verify that the values have changed.

(warning) Java 1.6 users may encounter the unhelpful system log error "The Apache Tomcat service terminated with service-specific error 0 (0x0)". This can be fixed by copying the file msvcr71.dll from the /bin directory into the server or client directory with the jvm.dll file.

To set up remote debugging, please see (Remote Debugging).