Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat 7 skip specific folder loading from webapps

I am having two .war files, say webapp-A.war and webapp-B.war of two different projects. When I start tomcat, it deploys these wars and two folders are created in webapps directory i.e. webapp-A and webapp-B.

When I start tomcat both these folders are scanned and loaded. This increases the startup time of tomcat and consumes more memory. I dont want to work on both at a time but I must be able to switch between any two.

So, is there any way to skip loading of webapp-B when I am working on webapp-A considering both being present in webapps directory?

like image 788
Vaibhav Kakade Avatar asked Oct 20 '25 04:10

Vaibhav Kakade


1 Answers

When working with webapp-A, go to TOMCAT_HOME/conf/server.xml and update the host tag with attribute 'deployIgnore' as shown below

<Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true" deployIgnore="webapp-B">

....
</Host>

Start your tomcat server, webapp-B will not be deployed :)

This is my very first answer on stackoverflow btw, hope it helps, I signed up to help you.

like image 120
ipulkit Avatar answered Oct 26 '25 17:10

ipulkit



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!