1,tomcat: 作为Windows服务进行管理
http://tomcat.apache.org/tomcat-8.0-doc/windows-service-howto.html
- 1, 递归创建目录: apache-tomcat-8-muti-instance/instances/instance1
- 2 , 解压tomcat: 把bin, lib 放到apache-tomcat-8-muti-instance目录里
- 3,把conf放到apache-tomcat-8-muti-instance目录里,把conf/{server.xml, web.xml} 两个文件挑出来
- 4,把其余目录放到instances/instance1里面,保持instance1里面的conf只有server.xml, web.xml
D:\software\apache-tomcat-8-muti-instance
λ ls
bin/ conf/ instances/ lib/
D:\software\apache-tomcat-8-muti-instance
λ ls instances\node_instance1
conf/ logs/ temp/ webapps/ work/
D:\software\apache-tomcat-8-muti-instance
λ ls conf\ ##把server.xml , web.xml转移到instances/instance1,2,3里面
Catalina/ catalina.policy catalina.properties context.xml jaspic-providers.xml jaspic-providers.xsd logging.properties tomcat-users.xml tomcat-users.xsd
D:\software\apache-tomcat-8-muti-instance
λ ls instances\node_instance1\conf\
Catalina/ server.xml web.xml
#### 设置变量: CATALINA_HOME是基本目录, 里面有多个instance: CATALINA_BASE
############### 安装实例1 ###############
D:\software\apache-tomcat-8-muti-instance\bin
λ set CATALINA_HOME=D:\software\apache-tomcat-8-muti-instance
D:\software\apache-tomcat-8-muti-instance\bin
λ set CATALINA_BASE=D:\software\apache-tomcat-8-muti-instance\instances\node_instance1
D:\software\apache-tomcat-8-muti-instance\bin
λ service.bat install tomcat8_instance1
Installing the service 'tomcat8_instance1' ...
Using CATALINA_HOME: "D:\software\apache-tomcat-8-muti-instance"
Using CATALINA_BASE: "D:\software\apache-tomcat-8-muti-instance\instances\node_instance1"
Using JAVA_HOME: "D:\software\jdk1.8.0_3"
Using JRE_HOME: "D:\software\jdk1.8.0_3\jre"
Using JVM: "D:\software\jdk1.8.0_3\jre\bin\server\jvm.dll"
The service 'tomcat8_instance1' has been installed.
############### 安装实例2 ###############
D:\software\apache-tomcat-8-muti-instance\bin
λ set CATALINA_BASE=D:\software\apache-tomcat-8-muti-instance\instances\node_instance2
D:\software\apache-tomcat-8-muti-instance\bin
λ service.bat install tomcat8_instance2
Installing the service 'tomcat8_instance2' ...
Using CATALINA_HOME: "D:\software\apache-tomcat-8-muti-instance"
Using CATALINA_BASE: "D:\software\apache-tomcat-8-muti-instance\instances\node_instance2"
Using JAVA_HOME: "D:\software\jdk1.8.0_3"
Using JRE_HOME: "D:\software\jdk1.8.0_3\jre"
Using JVM: "D:\software\jdk1.8.0_3\jre\bin\server\jvm.dll"
The service 'tomcat8_instance2' has been installed.