With the Apache Tomcat, there is a default service.bat script in the bin\ folder which allows configuration customization. For example, you can configure JVM settings and environment variables that are needed to run Tomcat as a service.
For tcServer there are couple of ways to add additional variables and/or JVM options when running tc Server as a windows service. The most common approach is to modify the Tomcat service wrapper.
However before modifying the wrapper, you need to understand how to install tcServer as a windows service. To install tcServer as a Windows service:
• Create the tcServer instance with the “tcserver-instance” script
• Then install the windows service for that new instance by changing into the bin\ folder and running the “tcserver-ctl.bat” with the flag “install”
Now that you understand how to create service to modify the behaviour of the wrapper you must edit the \conf\wrapper.conf file. This file can be edited to tweak the behavior of the window service as well as changing JAVA_HOME, JVM parameters and any other desired environment variables. For example:
set.some_variable=some_value
NOTE: These variables will only be set if tcServer Tomcat is started as a Windows Service.
The other option to configure additional variables is through the setenv.bat script. This script resides in the instance's bin\ folder. In modifying this file, JAVA_OPTS (used during START/STOP/RUN) and CATALINA_OPTS (used during START/RUN) can be added or modified. When tcServer is started, this file will be invoked, allowing the user to set these variables at runtime. This file invoked whether tcServer is started as a Windows service or not. This is an alternative method when Tomcat is not run as a Window service.
Popular Links
Comments
Post new comment