|
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:
-
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.
-
Download and install Service Protector, if necessary.
-
Start Service Protector.
-
Select Protector > Add to open the Add Protector window:
-
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.
-
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.
-
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.
-
Check the Whenever it fails a "sanity check" box. Click the ... button and specify the full path to the batch file.
-
Specify how often to check. The default of 30 seconds may be too frequent, so we changed it to 5 minutes.
-
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.
-
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).
-
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:
-
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?
|
Peace of mind for your important Windows Services!
|
|
|
Step-by-step guides for 70+ Services
|