Configuring two or more Tomcat-initiated methods under Windows

Source: Internet
Author: User

Ensure that Catalina_home and catalina_base are not found in the window's environment variables

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

1. Modify the HTTP access port

The service access port of the Server.xml file under Conf, 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 another port

My opinion on installing and starting multiple Tomcat services on one machine under Windows

Background:

What do we do if we need to deploy a beta Web application to tomcat on a machine that has been installed with Tomcat services and that the Tomcat service is running other more important Web applications? ". Obviously it is not possible to simply put the test project and those important Web applications together, so that the crash of the beta will not work at the same time, because they are running on the same JVM. This will require the installation of a Tomcat service to run this beta web app alone! (Online search for countless articles, after their own repeated testing finally came to fruition)
Tomcat installation package:

: http://tomcat.apache.org/index.html
Download content: You must download the Linux version of Tomcat, not the 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 generally a Windows version, and there is no need to uninstall it. (This will ensure that the original service is running properly)

Let's talk about why:

The reason why you cannot use the Windows version installation package is because the service name must be unique and cannot conflict. Each time you install a Windows version of Tomcat that is the same service name, the second installation overwrites the first installed service! (When you install the second time, you will find that even if the directory is different, the environment configuration used is the same regardless of which service is started.) )
Using the Linux version (green version) is not the installation process, its own manual configuration service name, environment variables, etc., so that two Tomcat will not conflict

To start 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 the locations in the site to not conflict with the Tomcat service ports installed on the server.

The code is as follows:
Find 8080, modify to 8081, find 8443, modify to 8543, find 8009, change to 8019;
Find 8005, modify to 8015, find 8082, modify to 8182

Write and execute the Installservice.bat (any directory) batch file.

The code is 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 service name that you define. Do not use special symbols such as dots or underscores or minus signs in service naming to avoid unsuccessful service registrations.
Specifying Java_home allows 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 service MyTomcat6 just installed, right-click, start it.
D:/tomcat6/bin/service.bat Remove MYTOMCAT6 can delete a registered service.

Share experience:

The Linux version of Tomcat has many batch files under the Bin directory, where the *.bat file can be executed under Windows, and the *.sh file is executed under Linux.
We will find that the Linux version of the Tomcat Bin directory will also have tomcat6.exe,tomcat6w.exe these two files, never to open it, modify the configuration, and then start the service.
Tomcat6.exe,tomcat6w.exe these two files will automatically go to open the service name: "TOMCAT6" Service (other version of Tomcat), if you do not give an error in the execution of these two files, indicating that it found the name "Tomcat6" Service (if the server was originally TOMCAT5 you are lucky). No matter how you modify the configuration, it is a modification to the TOMCAT6 service, not the configuration for the "MYTOMCAT6" service at all. (I was wrong, the server's original Tomcat service crashed 5555555)

Set the memory used by the JVM: we all know that the general Windows version of Tomcat after installation can be performed Tomcat6w.exe, configured in the popup configuration interface. But how do we set up a Linux version of Tomcat that was installed in Windows by way of registration? O (∩_∩) o haha ~

Online all say modify Catalina.bat file 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 execute (nor can we configure $catalina_home to install multiple tomcat, to specify which one is not). and instant use of Catalina.bat to start the service, as long as the server logoff Tomcat service will stop.
Open the registry: [Hkey_local_machine/software/apache Software Foundation/procrun 2.0], you can see the successful registered, different names of all Tomcat services, modify it.

Configuring two or more Tomcat-initiated methods under Windows

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.