Tomcat多实例

来源:互联网 发布:网络销售如何提高业绩 编辑:程序博客网 时间:2024/05/16 12:35

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


①Install a copy of Tomcat 6 to a directory (like C:\apache-tomcat-6.0.20).

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

1set CATALINA_BASE=C:\tomcat-1 
2set CATALINA_HOME=C:\apache-tomcat-6.0.20 
3C:\apache-tomcat-6.0.20\bin\startup.bat
⑤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.