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

修改server.xml文件:



 <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

Attribute Description
autoDeploy This 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

Attribute Description
reloadable Set 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官方文档

你可能感兴趣的:(其他,tomcat,centos)