tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Tomcat 7 deployments context
Date Wed, 05 Nov 2014 18:25:45 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Jose,

On 11/5/14 12:51 PM, Jose Monreal wrote:
> Sorry for the but information or no information at all provided. 
> What I'm trying to achieve is that when deploying my app on tomcat,
> this will take the context from the META-INF/context.xml and deploy
> it with that path(context) that's different from the name of the
> war.

You need to take your META-INF/context.xml file and put it into
CATALINA_BASE/conf/[engine]/[host]/[appname].xml

> From the documentation I get that disabling autoDeploy and
> deployOnStartup should do the job, but with that configuration
> tomcat won't deploy anything at all, not even the apps already
> deployed in the webapps directory.

It will deploy the applications in conf/.../[appname].xml as above.

> Lets say my war filename is myapp.war but the context is 
> /ws/test/application/2.3/,  Is it possible for tomcat to take that
> context and deploy the app with that context? how?

Take your META-INF/context.xml file and copy it into
CATALINA_BASE/conf/[engine]/[host]/ws#test#application#2.3.xml

[engine] the name of your <Engine> in server.xml and it almost always
"Catalina". [host] is the name of the <Host> under which the context
should be deployed. If you are using a default configuration (which
seems like a good idea in general), this will be "localhost". So, put
your file into
CATALINA_BASE/conf/[engine]/[host]/ws#test#application#2.3.xml

Make sure that you:

1. Remove any "path" parameter from <Context>
2. Add a "docBase" to your ws#test#application#2.3.xml pointing to the WAR
2. Either keep autoDeploy="false" or move your WAR file out of
webapps/ and adjust the "docBase" in your deployment descriptor
accordingly, otherwise you'll get a double-deployment

Please read
http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Defining_a_context
before replying again.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJUWmupAAoJEBzwKT+lPKRY8xsP/AtD705SRAfih3sy7X5zPgGu
2SbuoOzIvjJc9hFgGOlaA1PTGKsibtX8U2kY23jylNyakt/UvQhlx76hRVPj5lI6
4IHXj3zn9u+shFo0zFKneGpDbNEmgA/v7kMt0VP0xZROCFjdjO2Jxq3Cwrmmk7K8
8cRuK3J0FA3ABrDTQAKfzqTmhVmElPIiDnp8KRIlUekiqBmgAskeoflO67eYKDsH
6Tg3gjuGiJL+9Dc8kA8my6Qtxs+I7/j2oGk3sbfQ3sruPwarbQS+ZA7JNaugUarJ
A3uaNXs2Fw3e55x0Zp9ud5SCe+J4sBEgPsQAuCRYQAwm/6JU5hWEN6SinEwvZnhQ
ZU+1NtfghBSUkHNvazbcxGUlXpwJAwHj3fwEk4ezIkv4bCUm7rj0snQf24kFl777
6jbv6ih8n/TSkS94HWmd4EKFEla0nEWzYC3u335fWFzopS+zaaSriQUQVldsQmPa
IV2/ZMNsRLnqrTXyG0uSWZs12ScLMIBDyu4nnnd7HRpd++A2ACi0cePOeSWv3BvD
bdTQVWj6JAgcPY2fXLcFSs6uVfJJXMB/24nNtTWxjakKgAeGXae9tW+9iUpoG0Za
4246P8D71SH8p451+Zb0RXObKuTIdK4E4iYJBYe7Vc94C2qSchJbGwVt09p7JDN8
0XEwugAjlPhV8uBLJw+Q
=lqob
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message