使用多个 CATALINA_BASE 在 windows 上设置 tomcat 6 实例 [英] use multiple CATALINA_BASE to setup tomcat 6 instances on windows

查看:33
本文介绍了使用多个 CATALINA_BASE 在 windows 上设置 tomcat 6 实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

tomcat 发行版自带的 RUNNING.txt 表示使用 CATALINA_BASE 变量启用多个 tomcat 实例.但是如何为每个 tomcat 实例目录设置 CATALINA_BASE 环境变量?

The RUNNING.txt that comes with tomcat distribution indicates the use of CATALINA_BASE variable to enable multiple tomcat instance. But how can I set the CATALINA_BASE environment variable for each tomcat instance directory?

推荐答案

在您的开发机器上拥有多个 Tomcat 实例非常棒.以下是我通常在 Windows 上的做法(设置的重要部分在步骤 2、3、4 和 5):

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):

  1. 将 Tomcat 6 的副本安装到某个目录(例如 C:\apache-tomcat-6.0.20).
  2. conf 目录复制到另一个目录(如 C:\tomcat-1)
  3. C:\tomcat-1下,创建一个bin目录
  4. C:\tomcat-1\bin 目录中,创建一个名为 startup.bat 的文件,内容如下:

  1. Install a copy of Tomcat 6 to a directory (like C:\apache-tomcat-6.0.20).
  2. Copy the conf directory to another directory (like C:\tomcat-1)
  3. Under C:\tomcat-1, create a bin directory
  4. 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

C:\tomcat-1\bin 目录中,创建一个名为 shutdown.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

可选:在 C:\tomcat-1\bin 目录中创建一个名为 setenv.bat 的文件来设置 中提到的任何环境变量C:\apache-tomcat-6.0.20\bin\catalina.bat.这是设置系统属性、JPDA 地址等的地方.

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.

尽量不要将Tomcat安装在名称中有空格的目录中.它应该可以工作,但你会遇到更少的问题.如果您使用 Windows 的tomcat 即服务"选项,我不知道这将如何工作.

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.

从这里,您应该能够隔离 tomcat 实例.请务必编辑您的 conf\server.xml 文件,以便关闭端口和 HTTP 连接器端口不会干扰可能正在运行的其他 Tomcat 实例.我通常为关闭端口分配 8005、8006、8007 等值,为 HTTP 连接器端口分配 8080、8081、8082 等值.

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.

这篇关于使用多个 CATALINA_BASE 在 windows 上设置 tomcat 6 实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆