Start multiple tomcats

The first method: need to configure environment variables

 

first tomcat

 

Configure the CATALINA_HOME environment variable to point to the tomcat installation directory

 

For example: E:\sdfxw\tomcat5-sdfxw

 

Configure the environment variable path to point to %CATALINA_HOME%\bin

 

Enter /Tomcat path/bin/ in the command line, execute "service.bat install [service name] So far, a tomcat service has been added to the windows service.

 

Install second tomcat

 

Configure the CATALINA_HOME2 environment variable to point to another tomcat directory

 

Configure the environment variable path to point to %CATALINA_HOME2@%\bin

 

Enter the bin directory of tomcat and find catalina.bat, startup.bat, service.bat

 

Replace all CATALINA_HOME with CATALINA_HOME2

 

Enter the second /Tomcat path/bin/ in the command line, and execute "service.bat install": (start-run, enter cmd, cd Tomcat path/bin, service.bat install). So far, a tomcat service has been added to the windows service

 

So far, the two tomcat configurations are complete

 

 

 

 

 

 

Of course, you need to modify the port of tomcat, which will not be said here.

 

 

 

The second method

 

 

Applicable to Tomcat4.1, 5.5, 6.0.

 

For the decompressed version of Tomcat installation, see: http://www.blogjava.net/fastunit/archive/2008/05/22/202112.html

 

Because the decompressed version of Tomcat does not have a startup item on the windows service, it needs to be added manually, and then you can set the startup to start tomcat.

 

1. Installation service

 

Enter /Tomcat path/bin/ on the command line, and execute "service.bat install": (Start-Run, enter cmd, cd Tomcat path/bin, service.bat install). So far, a tomcat service has been added to the windows service

 

 

 

illustrate:

 

1、服务名和显示名称:service.bat中设置了默认的服务名称,不同版本分别命名为Tomcat4、Tomcat5、Tomcat6,如果需要自定义服务名或服务的显示名称,可在service.bat中修改SERVICE_NAME或PR_DISPLAYNAME;

 

2、防火墙的影响:/bin/tomcat6.exe(或tomcat4.exe、tomcat5.exe)将被作为服务程序,如果有防火墙,需要设为允许作为服务。

 

二、卸载服务

 

在命令行中进入/Tomcat路径/bin/,执行“service.bat remove”:

 

三、命令行参数

 

Tomcat的服务名、Jvm内存初始值和最大值等可通过命令行参数设置,请参考官方文档:

 

http://tomcat.apache.org/tomcat-5.5-doc/windows-service-howto.html

 

http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html

 

 

 

四、开机启动Tomcat设置

 

开始-控制面板-管理工具-服务

 

找到apche tomcat 右键属性,把手动改为自动

 

 

 

 

 

 

 

如果还是不行,也可以添加任务。操作步骤

 

开始==》控制面板==》任务计划==》添加任务计划

 

下一步

 

浏览

 

找到免安装的tomcat根目录下的bin目录,选择startup.bat打开

 

选择计算机启动时

 

下一步

 

输入用户名和密码

 

完成

 

 

 

 

安装第二个Tomcat重复一次上面操作即可

 

 

 

这个我没有经过测试,个人认为应该可用

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326444946&siteId=291194637