tomcat CATALINA_BASE multi instance on windows 在window下启动多个tomcat实例
来源:互联网 发布:淘宝子账号有哪些权限 编辑:程序博客网 时间:2024/06/15 20:38
有时我们会遇到这种情况,要启动多个tomcat实例,这些tomcat实例共享同一个tomcat,各实例之间的启动和停止是独立的。要实现这个我们可以通过设置多个CATALINA_BASE目录来实现(CATALINA_BASE是Tomcat的工作目录),它们共享同一个CATALINA_HOME(tomcat安装目录)。
- 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.
------------------------
1.电脑环境变量设置:
TOMCAT_HOME=D:\tomcat6
2.tomcat结构
D:\tomcat6
|---bin
|---conf
|---lib
|---logs
|---temp
|---webapps
|---host-manager
|---manager
|---work
|---tomcat6_clone1
|---startup.bat
|---shutdown.bat
|---conf
|---logs
|---temp
|---webapps
|---host-manager
|---manager
|---work
|---tomcat6_clone2
|---startup.bat
|---shutdown.bat
|---conf
|---logs
|---temp
|---webapps
|---host-manager
|---manager
|---work
配置tomcat6_clone1的start.bat()
set "CATALINA_BASE=%TOMCAT_HOME%\tomcat6_clone1"
set "CATALINA_HOME=%TOMCAT_HOME%"
call %TOMCAT_HOME%\bin\startup.bat
配置tomcat6_clone1的shutdown.bat
set "CATALINA_BASE=%TOMCAT_HOME%\tomcat6_clone1"
set "CATALINA_HOME=%TOMCAT_HOME%"
call "%TOMCAT_HOME%\bin\shutdown.bat"
配置tomcat6_clone1\conf\server.xml中的默认的连接端口、SSL的连接端口、Apache的侦听端口、停止Tomcat的端口等端口(默认8080、8443、8009、8005)
配置tomcat6_clone2的start.bat()
set "CATALINA_BASE=%TOMCAT_HOME%\tomcat6_clone2"
set "CATALINA_HOME=%TOMCAT_HOME%"
call %TOMCAT_HOME%\bin\startup.bat
配置tomcat6_clone2的shutdown.bat
set "CATALINA_BASE=%TOMCAT_HOME%\tomcat6_clone2"
set "CATALINA_HOME=%TOMCAT_HOME%"
call "%TOMCAT_HOME%\bin\shutdown.bat"
配置tomcat6_clone2\conf\server.xml中的默认的连接端口、SSL的连接端口、Apache的侦听端口、停止Tomcat的端口等端口
注意:tomcat6_clone1和tomcat6_clone2的同一类型的端口配置值要不同。
其他是项目配置
转自:http://jms-exception.iteye.com/blog/1405344
其他参考资料:http://blog.sina.com.cn/s/blog_69f5b16e0100uo6v.html
http://blog.csdn.net/bfox/article/details/712726
http://yuri-liuyu.iteye.com/blog/960964
http://www.cnitblog.com/stomic/archive/2009/09/11/61359.aspx
- tomcat CATALINA_BASE multi instance on windows 在window下启动多个tomcat实例
- windows下同时启动多个tomcat
- Windows下启动多个tomcat
- windows下同时启动多个tomcat
- Windows下多Tomcat实例
- Windows 下tomcat 启动多个Spring项目
- window下配置多个tomcat
- window系统下部署多个tomcat
- CATALINA_BASE和CATALINA_HOME,多实例tomcat与多版本tomcat运行
- 如何在Linux下安装启动多个Tomcat
- 如何在Linux下安装启动多个Tomcat
- windows下启动tomcat
- Windows 下启动tomcat
- 在windows下配置多个tomcat服务器
- tomcat CATALINA_BASE环境变量配置
- Tomcat在window下直接启动出现一闪而过
- Windows下在一台机器上安装并同时启动多个Tomcat服务之我见
- linux下配置,启动多个tomcat
- iphone 隐藏状态栏,隐藏UINavigationController
- 键码值(keyCode)
- java 网络编程
- 软件开发流程
- Huffman 编码压缩算法
- tomcat CATALINA_BASE multi instance on windows 在window下启动多个tomcat实例
- 自己写的一个图片上传类,很方便可以指定目录,系统自动创建目录,可以指定名字,类型,大小
- oracle 实例与数据库的概念
- 将GridView和数据库查询结果绑定起来后,点击查询出了结果。但是点击第二面或者其他的,就直接变空白了。(已经解决)
- 抓取网页内容
- myeclipse连接oracle出现ora-12705错误的解决办法
- UIImageView增加点击事件
- input输入框无边框和调结宽度
- MyBatis学习 之 三、SQL语句映射文件-增删改查、参数、缓存