使用 Tomcat 作为 Windows 服务的原因是什么?
我已经使用 Tomcat 作为 Web 容器很长一段时间了,但我从未遇到过将 Tomcat 作为 Windows 服务使用的情况。到目前为止,我在想为什么 Tomcat 实现者提供了将 tomcat 作为 Window Service 运行的工具。
使用 Tomcat 作为 Windows 服务而不是在命令行上使用
startup.bat
和shutdown.bat
可以获得哪些优势?真的能用在生产环境吗?
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.
What are the advantages we get by using Tomcat as a Windows Service rather than using
startup.bat
andshutdown.bat
on the command line?Is it really used in production environment?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Q1:您不需要登录活动用户会话。当机器启动时,您的服务器也启动。您不会因退出前台进程而意外停止服务。
问题 2:是的,在 Shure Windows Server 产品上。
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.
如果 Tomcat 作为服务运行,您可以确保它在机器启动时重新启动
因任何原因意外重启;如果该服务您可以采取行动
崩溃;您可以相当简单地以指定用户身份运行该服务。
如果从命令行运行,则没有这些选项。
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.
将 Tomcat 作为在启动时自动启动的服务运行是在任何环境(windows、Linux、unix)中运行应用程序服务器的首选方式。
原因是什么?如果应用程序服务器需要一直运行,则无需登录来手动启动它。正如应用程序服务器通常所做的那样。
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.
您可以将服务设置为在电脑开机时自动启动。这对于您希望 Tomcat 在重新启动或崩溃后重新启动的服务器非常有用。
是的,当我们必须设置 Windows 服务器时,我们总是使用该设置。
在开发机器上,有些人使用它是因为从系统托盘启动/停止 Tomcat 很方便。
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.
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.