Index: windows-service-howto.html =================================================================== --- windows-service-howto.html (revision 1479333) +++ windows-service-howto.html (working copy) @@ -19,7 +19,7 @@

       The Apache Tomcat Servlet/JSP Container

Apache Tomcat 7

Version 7.0.39, Mar 22 2013
Apache Logo

Links

User Guide

Reference

Apache Tomcat Development

Windows service HOW-TO

Table of Contents
- +
Tomcat7 service application

Tomcat7 is a service application for running Tomcat7 as NT service. @@ -303,7 +303,14 @@ C:\> service.bat install

+

There is a 2nd optional parameter that lets you specify the name of the service, as displayed in Windows services

+

+Install the service named 'MyService'
+C:\> service.bat install MyService
+
+

+

If using tomcat7.exe, you need to use the //IS// parameter.

@@ -327,6 +334,14 @@ C:\> --Startup=auto --Classpath=%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\bin\bootstrap.jar

+

If you gave the service an optional name, you need to specify it like this

+

+

+Update the service named 'MyService'
+C:\> tomcat7 //US//MyService --Description="Apache Tomcat Server - http://tomcat.apache.org/ " \
+C:\> --Startup=auto --Classpath=%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\bin\bootstrap.jar
+
+

Removing services

To remove the service, you need to use the //DS// parameter.
@@ -338,6 +353,13 @@ C:\> tomcat7 //DS//Tomcat7

+

If you gave the service an optional name, you need to specify it like this

+

+

+Remove the service named 'MyService'
+C:\> tomcat7 //DS//MyService
+
+

Debugging services

To run the service in console mode, you need to use the //TS// parameter. @@ -354,6 +376,51 @@ C:\> tomcat7

+
Multiple Instances
+

+Tomcat supports installation of multiple instances. You can have a single installation of tomcat with multiple instances running on different IP/Port combinations, or multiple tomcat versions, each running 1 or more instances on different IP/Ports. +

+

+Each Instance folder will need the following structure +

+
    +
  • conf
  • +
  • logs
  • +
  • temp
  • +
  • webapps
  • +
+

+At a minimum, conf should contain a copy of the following files from CATALINA_HOME\conf\server.xml. Any files not copied and edited, will be picked up by default from CATALINA_HOME\conf, i.e. CATALINA_BASE\conf files override defaults from CATALINA_HOME\conf. +

+
    +
  • server.xml
  • +
  • web.xml
  • +
+

+You must edit CATALINA_BASE\conf\server.xml to specify a unique IP/port for the instance to listen on. Find the line that contains

<Connector port="8080"
and update the port number so as to specify a unique port +

+

+To install an instance, first set the CATALINA_HOME environment variable to the name of the tomcat directory. Then create a second environment variable CATALINA_BASE and point this to the instance folder. Then run "service install" command specifying a service name +

+

+

+set CATALINA_HOME=c:\tomcat_7
+set CATALINA_BASE=c:\tomcat_7\instances\instance1
+service install instance1
+
+

+

+To modify the service settings, you can run tomcat7w //ES//instance1 +

+

+For additional instances, create additional instance folder, update the CATALINA_BASE environment variable, and run the service install again +

+

+

+set CATALINA_BASE=c:\tomcat_7\instances\instance2
+service install instance2
+
+

Comments

Notice: This is not a Q&A section. The Apache Comments System is explained here.