Keep Apache Tomcat Windows Service running 24/7

How to Keep Tomcat Windows Service Running 24/7 with Service Protector

Quickly auto-restart Tomcat when it crashes, gets stuck or stops serving web pages. Ensure 100% uptime for your java web applications today!

Tomcat is a popular, open source Java Servlet engine developed by the Apache Foundation.


To monitor & protect Tomcat with Service Protector:

  1. Download, install, and configure Tomcat as a Windows Service, if necessary. We have installed version 7.0.35 on our Windows Server 2008 R2 server.

  2. Download and install Service Protector, if necessary.

  3. Start Service Protector.

  4. Select Protector > Add to open the Add Protector window:

    Add Protector

  5. On the General tab:

    • In the Service to protect field, choose the Tomcat windows service. This will be named Apache Tomcat X.Y TomcatX, where X.Y represents the software's version number. Since we have installed Tomcat version 7.0.35, our service is named Apache Tomcat 7.0 Tomcat7.

      You will notice a green circle to the left of the name if Tomcat is already running, as pictured below.

    Tomcat Windows Service: General Tab

  6. Click over to the Monitor tab, where we will set up a failure detection script to tell Service Protector when Tomcat has failed and is not serving web pages.

    1. Follow these instructions to create the failure detection BAT file. We have called ours check-tomcat.bat and placed it in a folder called C:\TomcatTools.

    2. Check the Whenever it fails a "sanity check" box. Click the ... button and specify the full path to the batch file.

    3. Specify how often to check. The default of 30 seconds may be too frequent, so we changed it to 5 minutes.

    Tomcat Windows Service: Monitor Tab

  7. If you find that the Tomcat windows service occasionally gets stuck in the "Stopping" or "Starting" state, click over to the Extras tab and check the corresponding options.

    Tomcat Windows Service: Extras Tab

  8. Click the Save >> button. In a second or two, an entry for Apache Tomcat will show up in the Service Protector window. Here the Tomcat service is already running but it's not yet being monitored by Service Protector (hence the red shield).

    Tomcat Windows Service: Created

  9. To start protection, choose Protector > Start "Apache Tomcat 7.0 Tomcat7". The shield icon will go to green to indicate that the Tomcat service is being protected:

    Tomcat Windows Service: Protected

  10. That's it! Next time your computer boots, Tomcat will start (as normal) and Service Protector will begin watching the service to promptly restart it if it stops for any reason.

    We encourage you to edit Tomcat in Service Protector and check out the many other settings that may be appropriate for your environment. For example, send email alerts when the service fails, restart Tomcat nightly to cure memory leaks, detect CPU hogging, and much more.



Trouble protecting the Tomcat Windows Service?

Download & Try it Free!

Protect your Windows Service - Download now! Version 4.5

3.6 MB Installer
  • Unrestricted 30-day trial for new users
  • Upgrade for existing users
  • Windows 8.1/8/7/ Vista/XP and Windows Server 2012/2008/2003 supported
  • How to Install
Our customers include...


Windows Server 2012 Certified (32 & 64-bit)

Windows 8 Compatible (32 & 64-bit)

Compatible with Windows 7 (32 & 64-bit)

Works with Windows Server 2008 R2 (32 & 64-bit)



Peace of mind for your important Windows Services!
 
Service Protector is number 1! Auto-Restart Windows Services when they fail