You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Konstantin Kolinko (Confluence)" <no...@apache.org> on 2019/11/24 19:30:08 UTC

[CONF] Apache Tomcat > Deployment

There's **1 new edit** on this page  
---  
|  
---  
|  | [![page icon](cid:page-
icon)](https://cwiki.apache.org/confluence/display/TOMCAT/Deployment?src=mail&src.mail.product=confluence-
server&src.mail.timestamp=1574623808169&src.mail.notification=com.atlassian.confluence.plugins.confluence-
notifications-batch-plugin%3Abatching-
notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db&src.mail.action=view
"page icon")  
---  
[Deployment](https://cwiki.apache.org/confluence/display/TOMCAT/Deployment?src=mail&src.mail.product=confluence-
server&src.mail.timestamp=1574623808169&src.mail.notification=com.atlassian.confluence.plugins.confluence-
notifications-batch-plugin%3Abatching-
notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db&src.mail.action=view
"Deployment")  
|  |  |  |  | ![](cid:avatar_892fc5b633a433d86a56f192323474ea) |  | Konstantin
Kolinko edited this page  
---  
|  
|  | Here's the version comment  
---  
|  
---  
|  |  | ![](cid:avatar_892fc5b633a433d86a56f192323474ea) |  | Konstantin
Kolinko edited at [07:27
PM](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=103098853)  
---  
|  |  |  Add a permalink. Fix formatting. Convert links to https.  
---  
|  
|  | Here's what changed:  
---  
|

_Permalink_ to this page: [
https://cwiki.apache.org/confluence/x/5SklBg](https://cwiki.apache.org/confluence/x/5SklBg)

## Preface

This section of the FAQ discusses common questions related to web application
deployment.

...

  1. [Why does tomcat 5 create context configuration files?](/confluence/pages/viewpage.action?pageId=103098853)
  2. [Why does the memory usage increase when I redeploy a web application?](/confluence/pages/viewpage.action?pageId=103098853)

## Answers

###  |
![](https://cwiki.apache.org/confluence/s/en_GB/8100/6ef1ce95c788ac159314a8fa6387047b8d1cc9fb/_/images/icons/macrobrowser/dropdown/anchor.png)
Anchor  
---  
|  | Q1  
---|---  
| Q1  
Why does tomcat 5 create context configuration files?

####  Tomcat 5, Tomcat 6:

Unlike tomcat 4.x, tomcat 5.x creates context configuration files for you in
its `conf/[Engine name]/[Host name]` directory. This is part of the change in
tomcat's configuration mechanism from version 4.x to make overall
configuration more robust, flexible, and enterprise-friendly. Note, however,
that this has changed the recommended deployment practices for web
applications. These context configuration files are created by tomcat, but not
removed by tomcat, because the user may have changed them or other files in
the conf directory. The suggested practice for tomcat 5 is to place context
configuration files as `META-INF/context.xml` in your webapp, and use Tomcat's
Manager webapp to deploy/undeploy your applications. More details can be found
here: [MARC Archive](https://marc.info/?l=tomcat-user&m=107590945807699&w=2)

####  Tomcat 7 and later:

In Tomcat 7 the default behaviour has been changed to do not auto-create those
context configuration files.

The recommended practice of using `META-INF/context.xml` files is still the
same. Those files are discovered and processed in the same way. The difference
is that they are not copied to the `conf/[Engine name]/[Host name]`directory.

This is convenient, as you do not need to care of those copied files when
undeploying your application, and you do not need to care whether the `conf`
directory is writeable. This change in behaviour is documented in the
[Migration Guide](https://tomcat.apache.org/migration-7.html).

###
![](https://cwiki.apache.org/confluence/s/en_GB/8100/6ef1ce95c788ac159314a8fa6387047b8d1cc9fb/_/images/icons/macrobrowser/dropdown/anchor.png)
Anchor  
---  
|  | Q2  
---|---  
| Q2  
Why does the memory usage increase when I redeploy a web application?

That is because your web application has a memory leak.

...  
  
|  |  | [Go to page
history](https://cwiki.apache.org/confluence/pages/viewpreviousversions.action?pageId=103098853&src=mail&src.mail.product=confluence-
server&src.mail.timestamp=1574623808169&src.mail.notification=com.atlassian.confluence.plugins.confluence-
notifications-batch-plugin%3Abatching-
notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db "Go to page
history")  
---  
---  
| [View
page](https://cwiki.apache.org/confluence/display/TOMCAT/Deployment?src=mail&src.mail.product=confluence-
server&src.mail.timestamp=1574623808169&src.mail.notification=com.atlassian.confluence.plugins.confluence-
notifications-batch-plugin%3Abatching-
notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db&src.mail.action=view)  
---  
  
|  | [Stop watching
space](https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=TOMCAT&src=mail&src.mail.product=confluence-
server&src.mail.timestamp=1574623808169&src.mail.notification=com.atlassian.confluence.plugins.confluence-
notifications-batch-plugin%3Abatching-
notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db&src.mail.action=stop-
watching&jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ4c3JmOjhhYTk4MDk1NjlkNDIzY2QwMTZhMDQxMzMwNmYwMGRiIiwicXNoIjoiMzNiOWEyNmM2OGQxOTBkNWYwMTVlNzQzMGQxYzYzYzIwNTA2OWY0YmNjNzhkNmMxYjUyZGVmODhjNDg5YWFiYyIsImlzcyI6ImNvbmZsdWVuY2Vfbm90aWZpY2F0aW9uc0FSRUgtWFVEMS1QT1FHLUNTQU8iLCJleHAiOjE1NzUyMjg2MDgsImlhdCI6MTU3NDYyMzgwOH0.ogkdHqDnL4rtM6sj1RAPMbZxK2Oy6g3kpFFbUmp5xuc)
| •  
---|---  
[Manage
notifications](https://cwiki.apache.org/confluence/users/editmyemailsettings.action?src=mail&src.mail.product=confluence-
server&src.mail.timestamp=1574623808169&src.mail.notification=com.atlassian.confluence.plugins.confluence-
notifications-batch-plugin%3Abatching-
notification&src.mail.recipient=8aa9809569d423cd016a0413306f00db&src.mail.action=manage)  
---  
| ![Confluence logo big](cid:footer-desktop-logo)  
---  
This message was sent by Atlassian Confluence 6.15.8  
![](cid:footer-mobile-logo)  
---