Two or more Tomcat-initiated methods are configured under Windows _tomcat

Source: Internet
Author: User
Tags tomcat

Make sure that catalina_home and catalina_base are not found in the window's environment variables

Modify the Server.xml, use the uncompressed version of Tomcat, do not use the installation version.

1. Modify HTTP Access Port

conf under the Server.xml file's service access port, the default is 8080 can be changed to other, such as 7000

2, modify the shutdown port

Default 8005

3, modify the JVM to start the default port, the default port is 8009 <br><connector port= "8009" protocol= "ajp/1.3" redirectport= "8443"/> Changed to other ports

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

Background:

What are we going to 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 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 content: Linux version of Tomcat must be downloaded, not Windows version of!!!!!!!!! (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)

Let's talk about the 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 overrides the first installation 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

To begin the 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.

Copy Code code as follows:

Find 8080, modify 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 (any directory) batch files.

Copy Code code as follows:

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, the JDK inside the environment variable is used
System command line, enter services.msc, open Windows Service Manager, you can see the services just installed MYTOMCAT6, right click to start it.
D:/tomcat6/bin/service.bat Remove MYTOMCAT6 can delete a registered service.

Share experience:

There are many batch files in the Linux version of Tomcat's Bin directory, 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'm going to make a mistake and crash the server's original Tomcat service. 5555555)

To set the memory used by the JVM: Everyone knows that the general Windows version of Tomcat can be executed after Tomcat6w.exe, configured in a pop-up configuration interface. But how do we set up a Linux version of Tomcat that is installed by Windows through registration? O (∩_∩) o haha ~

It is said on the Internet that modifying the Catalina.bat file adds 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.

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.