tomcat CATALINA_BASE multi instance on windows

CATALINA_HOME是Tomcat的安装目 录,CATALINA_BASE是Tomcat的工作目录。如果我们想要运行Tomcat的 多个实例,但是不想安装多个Tomcat软件副本。那么我们可以配置多个工作 目录,每个运行实例独占一个工作目录,但是共享同一个安装目录。


Having multiple Tomcat instances on your development machine is great. Here's how I usually do it for Windows (the important parts for setup are in steps 2, 3, 4 and 5):

Install a copy of Tomcat 6 to a directory (like C:\apache-tomcat-6.0.20).[/align]
Copy the conf directory to another directory (like C:\tomcat-1)
Under C:\tomcat-1, create a bin directory

In the C:\tomcat-1\bin directory, create a file called startup.bat that reads like this:

    set CATALINA_BASE=C:\tomcat-1

set CATALINA_HOME=C:\apache-tomcat-6.0.20

C:\apache-tomcat-6.0.20\bin\startup.bat


In the C:\tomcat-1\bin directory, create a file called shutdown.bat that reads like this:

    set CATALINA_BASE=C:\tomcat-1

set CATALINA_HOME=C:\apache-tomcat-6.0.20

C:\apache-tomcat-6.0.20\bin\shutdown.bat


OPTIONAL: create a file called setenv.bat in the C:\tomcat-1\bin directory to set any environment variables mentioned in C:\apache-tomcat-6.0.20\bin\catalina.bat. This is the place to set system properties, JPDA addresses, etc.
Create the logs, temp, webapps and work directories under C:\tomcat-1
From the C:\tomcat-1 directory, run bin\startup.bat
Repeat for your other installs from step 2 for as many tomcat instances as you need.

Try not to install Tomcat in a directory that has spaces in its name. It should work, but you'll experience fewer problems that way. I do not know how this would work if you were using the "tomcat as a service" option for Windows.

From here, you should be able to isolate tomcat instances. Just be sure to edit your conf\server.xml file so that the shutdown ports and HTTP connector ports don't interfere with other Tomcat instances that may be running. I usually assign values like 8005, 8006, 8007, etc. for the shutdown port and 8080, 8081, 8082, etc. for the HTTP connector port.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值