[英]How to reload Tomcat Java Server application from command line?
我在重新编译 java servlet 文件后使用Tomcat Web 应用程序管理器重新加载 Tomcat 应用程序,有没有办法使用命令行重新加载应用程序?
I can think of a variety of ways to do this from the command line:我可以想到从命令行执行此操作的多种方法:
Copy the new WAR file to the webapps folder, or just touch it.将新的 WAR 文件复制到 webapps 文件夹,或者直接触摸它。
Use wget or curl to send the appropriate HTTP requests to the server's web management interface.使用 wget 或 curl 将适当的 HTTP 请求发送到服务器的 Web 管理界面。
Use the "catalina.sh" script ... if you haven't installed tomcat as a service.使用“catalina.sh”脚本......如果你还没有安装tomcat作为服务。
Run "/etc/init.d/tomcat restart" ... or however you restart a service on your system.运行 "/etc/init.d/tomcat restart" ... 或者你重新启动系统上的服务。
Note: I (too) have had difficulties in the past getting WAR file redeployment to work.注意:我(也)过去在重新部署 WAR 文件时遇到了困难。 When I'm doing Tomcat development, I tend to go for a full restart rather than redeploying individual servlets / WAR files.当我进行 Tomcat 开发时,我倾向于完全重启而不是重新部署单个 servlet/WAR 文件。
What is WAR file?什么是 WAR 文件?
Read this: http://en.wikipedia.org/wiki/WAR_file_format_%28Sun%29阅读: http : //en.wikipedia.org/wiki/WAR_file_format_%28Sun%29
I have a project symlink in /var/lib/tomcat7/webapps/app to my app directory and that's it and it work.我在 /var/lib/tomcat7/webapps/app 中有一个项目符号链接到我的应用程序目录,就是这样,它可以工作。
Bad idea, for a variety of reasons.坏主意,出于各种原因。 But if you insist, then I suggest trying approaches 2, 3 or 4 as described above.但是,如果您坚持,那么我建议您尝试上述方法 2、3 或 4。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.