My view on installing and starting multiple Tomcat services on a single machine in Windows

Source: Internet
Author: User

Background: What do we do if you need to deploy a beta Web application to tomcat on a single machine and have several Tomcat services installed on this machine, and the Tomcat service runs some of the other more important web applications. Obviously, it's not easy to put the test project together with those important web apps, so that the beta crash will not work for other applications either, because they're running on the same JVM. This will require the installation of a Tomcat service to run this beta Web application alone. (Online search countless articles, after their own repeated testing finally first results)

Tomcat installation package: Download address: http://tomcat.apache.org/index.html Download: Linux version of Tomcat must be downloaded, not Windows version ... (Http://apache.mirror.phpchina.com/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.zip) The server's original tomcat is typically version of Windows and there is no need to uninstall it. (This will ensure that the original service works)

For the first reason: You cannot use the Windows version to install the package because: the service name must be unique and cannot conflict. Each time you install the Windows version of Tomcat is the same service name, the second installation overwrites the first installation of the service. (When you install the second time, you will find that even if the directory is different, the environment configuration is the same regardless of which service is started.) Using the Linux version (green version) is not the process of installation, you manually configure the name of the service, environment variables, etc., so that two Tomcat will not conflict

Start installation: Unzip the Tomcat installation package and move to the directory you want. Modify the Conf/server.xml file to modify the ports involved in all locations inside to not conflict with the Tomcat service port installed on the server.

Find 8080, change to 8081, find 8443, change to 8543, find 8009, modify to 8019, find 8005, modify to 8015, find 8082, modify to 8182 write and execute Installservice.bat (arbitrary directory) batch files.

Set Java_home=d:/program files/java/jdk1.6.0_02 set catalina_home=d:/tomcat6 d:/tomcat6/bin/service.bat Install MyTomcat6 MyTomcat6 is the name of the service that you define. Do not use special symbols such as dots or underscores or minus signs in service naming to avoid unsuccessful service registrations. Specifies that Java_home can allow TOMCAT6 to use its own JDK. If not specified, use the JDK system command line inside the environment variable, enter services.msc, open Windows Service Manager, see the service myTomcat6 that you just installed, right-click, and start it. D:/tomcat6/bin/service.bat Remove MYTOMCAT6 can delete a registered service.

Sharing experience: The Linux version of Tomcat's Bin directory has many batch files, where *.bat files can be executed under Windows, and *.sh files are executed under Linux. We will find the Linux version of the Tomcat Bin directory will also have tomcat6.exe,tomcat6w.exe these two files, do not open it, modify the configuration, and then start the service on it. Tomcat6.exe,tomcat6w.exe these two files will automatically open the service name: "TOMCAT6" Service (other version of Tomcat), if you execute these two files do not complain, it found the name "Tomcat6" Service (You're lucky if the server was originally TOMCAT5). No matter how you modify the configuration, it is a modification to the TOMCAT6 service and is not a configuration for the "MYTOMCAT6" service at all. (I got it all wrong, and crashed the server's original Tomcat service. 5555555) set the memory used by the JVM: we all know that general Windows version of Tomcat can be executed after Tomcat6w.exe, configured in a pop-up configuration interface. But how to set up our Linux version of Tomcat installed in Windows through registration. O (∩_∩) o haha ~ Online are said to modify the Catalina.bat file to add this line: Set java_opts=-xms512m-xmx512m. I think it is undesirable, because we do not configure the global $catalina_home,catalina.bat not be able to perform (and it is not possible to configure $catalina_home to install multiple tomcat, to specify which one is not). And the service is started immediately using Catalina.bat, as long as the server logs out the Tomcat service stops. Open the registry: [Hkey_local_machine/software/apache SOFTWARE Foundation/procrun 2.0], you can see the successful registration of all Tomcat services with different names, modify it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.