如何使用命令提示符将war文件部署到tomcat? [英] How to deploy war file to tomcat using command prompt?
本文介绍了如何使用命令提示符将war文件部署到tomcat?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经创建了一个war文件并放入 tomcat / webapps
中。如何使用命令提示符将war文件部署到tomcat?
解决方案
此页面的早期答案是正确的,您可以复制/将WAR文件移动到位并重新启动tomcat,但是省略提及:您必须先删除之前展开的资产(从以前部署的WAR文件)(如果有的话)。
< pre class =lang-bash prettyprint-override>
#我的tomcat webapps被发现在/ var / lib / tomcat6 / webapps
#我想部署的应用程序是主(ROOT)应用程序
webapps_dir = / var / lib / tomcat6 / webapps
#删除现有资产(如果有)
rm -rf $ webapps_dir / ROOT
#将WAR文件复制到位
cp example_dir / ROOT.war $ webapps_dir
#重新启动tomcat
服务tomcat6 restart
- 已编译的WAR文件的路径(待部署)
- tomcat webapps文件的路径
- 如何重启tomcat(即如果没有作为服务安装)
I have created a war file and put into tomcat/webapps
. How to deploy a war file to tomcat using command prompt?
解决方案
The earlier answers on this page are correct that you can copy/move the WAR file into place and restart tomcat, but they omit to mention something: you must remove the previously exploded assets (from the previously deployed WAR file) if any are present.
# My tomcat webapps are found at /var/lib/tomcat6/webapps
# The application I wish to deploy is the main (ROOT) application
webapps_dir=/var/lib/tomcat6/webapps
# Remove existing assets (if any)
rm -rf $webapps_dir/ROOT
# Copy WAR file into place
cp example_dir/ROOT.war $webapps_dir
# Restart tomcat
service tomcat6 restart
Modify the following for your own system:
- Path of your compiled WAR file (to be deployed)
- Path of your tomcat webapps files
- How to restart tomcat (i.e. if not installed as a service)
这篇关于如何使用命令提示符将war文件部署到tomcat?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文