开发者

Prevent tomcat from starting application on deploy

Is there an开发者_开发技巧y way to tell Tomcat not to automatically start application which I want to deploy? I'd like to this manually.


In CATALINA_HOME/conf/server.xml:

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

Note the autoDeploy="false"


I understand your question as not deploying your app on starting Tomcat - if so,

At the <Host> in server.xml, deployOnStartup attribute set to false should do it.

But that will affect all webapps on that server. The default is true


For future reference, since at least Tomcat 7.0 every container has an undocumented property startChildren (cf. source code), which decides whether children should be automatically started.

Setting:

<Host startChildren="false" />

will prevent auto-deployed applications to start automatically.

Remark: this only applies to auto-deployed applications (i.e. those added to the StandardHost after it already started). The applications configured in server.xml will start automatically, when the StandardHost starts.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜