Windows under multiple Tomcat settings timed restart

Source: Internet
Author: User

1. Setting Environment variables

The Catalina_home value is the root directory of Tomcat,

Of course different tomcat can set multiple environment variables, such as catalina_home_v1,catalina_home_v2,catalina_home_v3 and so on .... But you need to change the corresponding catalina_home inside the Startup.bat to the value you set.


2. Modify Tomcat's process name

Because it involves the possibility of multiple tomcat booting at the same time, the process name is Java.exe, so it is necessary to set different tomcat different process names in order to differentiate.

In the setclasspath.bat file,

Change into

Copy "%java_home%\bin\java.exe" "%java_home%\bin\java_my.exe" set _runjava= "%java_home%\bin\java_my"

is to copy a java.exe out, Java_my is the new process name


3. Write the self-starter script file Start.bat

taskkill/f/t/im java_my.exeping 127.0.0.1-n 2d:\apache-tomcat-7.0.57-x64\bin\startup.batexit

4. In the system task plan, set the auto-run time to Start.bat.

Run the Start.bat script regularly, the system will kill the java_my process, and then restart.

Windows under multiple Tomcat settings timed restart

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.