Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the reason to use Tomcat as a Windows Service?

I have been using Tomcat as a web container for a significant time period but I never come across a situation to use Tomcat as a Windows Service. So far I was thinking why Tomcat implementors provide a facility to run tomcat as Window Service.

  1. What are the advantages we get by using Tomcat as a Windows Service rather than using startup.bat and shutdown.bat on the command line?

  2. Is it really used in production environment?

like image 977
Nuwan Arambage Avatar asked Feb 28 '11 09:02

Nuwan Arambage


4 Answers

Q1: You don't need to login into an active user session. Your server is up when the machine is up. You do not accidently stop the service by quitting a front process.

Q2: yes, on Windows Server products for shure.

like image 96
PeterMmm Avatar answered Oct 05 '22 07:10

PeterMmm


If Tomcat is running as a service, you can ensure it restarts if the machine reboots unexpectedly for any reason; you can take actions if the service crashes; and you can run the service as a specified user fairly simply. If you run from the command line, you have none of these options.

like image 40
Mudassir Avatar answered Oct 05 '22 09:10

Mudassir


Running Tomcat as a service that starts itself automatically on boot is the preferred way to run an application server in any environment: windows, Linux, unix.

The reason? You won't have to login to start application server manually if it is something that needs to be running all the time. As application servers usually do.

like image 30
Pablo Santa Cruz Avatar answered Oct 05 '22 08:10

Pablo Santa Cruz


what are the advantage we can get by using Tomcat as a Windows Service?

You can set the service to start automatically when the PC is turned on. This is useful for servers where you want Tomcat to start again after a reboot or crash.

Does it really use in production environment ?

Yes, we always use that setting when we have to set up Windows servers.

On development machines, some people use it because it's convenient to start/stop Tomcat from the sys tray.

like image 45
Aaron Digulla Avatar answered Oct 05 '22 07:10

Aaron Digulla