• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

avoid loading all applications under webapps

 
Kriss Reddy
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I have a couple of applications under webapps folder and by default all applications are loaded/started when I start my tomcat. I would like to know how to load/start only applications that I want at any given time. Is there some configuration to be done to achieve this.

example:
/webapps/app1
/webapps/app2
/webapps/app3

I want to load any one or more app(x) at any given time.

Thanks in advance.
Kriss.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Tomcat Web Application Manager lets you stop selected applications. I think that prevents them from loading when Tomcat is restarted, but have not tried it myself.
Bill
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could set the autoDeploy attribute to false in your server.xml's Host section and then explicitly configure the apps that you want to run via context entries in server.xml (or the newer context fragment files in tomcat/conf/Catalina/localhost).

Stopping them from the manager app won't keep them from starting when Tomcat restarts.
Undeploy will keep them from starting but it does this by deleting the entire directory which is probably not what you would want.
 
Kriss Reddy
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks for your replies.

Ben, is there any documentation about what you mentioned in your reply.

Thanks,
Kriss.
 
Kriss Reddy
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the links. Is this possible for 5.0.28 as well?
Kriss.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A crude but effective way of preventing Tomcat from loading an application would be to change the name of web.xml - without a web.xml on startup, Tomcat ignores the directory.
Bill
 
Bhoi Sandip
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello experts,

I have similar problem but somewhat different I wanted my application not to deploy if it do not find some system property defined.
I am using WAS (Websphere Application Server). Though I am throwing SystemPropertyNotFoundException (which extends InternalError) from context initialized method of listener, it is getting catched by deployment manager (the Error should not be catched) attached screenshot for details. Please help me out n what could be wrong
ExceptionCaught.JPG
[Thumbnail for ExceptionCaught.JPG]
 
zahir islam
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using tomcat 6. I have updated server.xml file as below, but still all my applications are loading at each startup:

<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="false"
xmlValidation="false" xmlNamespaceAware="false">

<Context path="/acbd" docBase="abcd" debug="0" reloadable="true"/>


<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>


</Host>


Am I missing anything?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic