centos部署tomcat,配置热加载和热部署

修改server.xml文件:

<!-- autoDeploy:热部署开关 -->
<!-- reloadable:热加载开关 -->
 <Host name="ltf.witn.com" unpackWARs="false" autoDeploy="false">
	<Context path="" reloadable="true" docBase="/opt/ltf"/>
</Host>

热加载:会监听项目文件夹下 /WEB-INF/classes/ 和 /WEB-INF/lib,当文件夹内容改变时自动重载该项目。热加载不会释放内存,适合测试环境。
热部署:会监听tomcat的appBase和xmlBase,当有新的包时自动部署到tomcat里。

参考tomcat的官方文档:

The Host Container

AttributeDescription
autoDeployThis flag value indicates if Tomcat should check periodically for new or updated web applications while Tomcat is running. If true, Tomcat periodically checks the appBase and xmlBase directories and deploys any new web applications or context XML descriptors found. Updated web applications or context XML descriptors will trigger a reload of the web application. The default is true. See Automatic Application Deployment for more information.

The Context Container

AttributeDescription
reloadableSet to true if you want Catalina to monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. That’s why the default setting for this attribute is false. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.

链接:tomcat官方文档

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值