You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Elad Messing <el...@gmail.com> on 2007/12/05 10:03:53 UTC

Deploying to a sub context

Hello All,
	I am new to this list, but couldnt find anything about this topic:
	
	I have a folder in my application which I would like to deploy in a
separate sub context. This is because it includes content media, and is very
large to include in the "main" application "war" every time I deploy it.

	What I would like to do is :
	1. Deploy my "application" war into the root context.
	2. Deploy the "media" files in a sub context, i.e. "/media". The
"docBase" for it will be outside the root context.
	3. All requests to http://domain/media will be redirected to the
"media" context
	

	This way I can quickly re-deploy the "application" context (small in
side) and only update the "media" context when there are changes there.

	How should this be done in the Tomcat context file/s ?


	Thank you

Elad
	


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


RE: Deploying to a sub context

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: eladm [mailto:elad.messing@gmail.com] 
> Subject: Re: Deploying to a sub context
> 
> I would like the users to be able to access the "media" 
> context with the url : "http:domain/images/media/".

That's not how you described it in your earlier message, but
nevertheless...

As has been discussed in this mailing list over the past few days:

1) Place your media webapp somewhere other than in your <Host> appBase
directory.  (This avoids double deployment.)

2) Create the file conf/Catalina/[host]/images#media.xml containing a
<Context> element with a docBase attribute that points to the location
of the media webapp.  [host] is normally localhost, unless you've
changed it in Tomcat's conf/server.xml file.

Doc reference:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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


Re: Deploying to a sub context

Posted by eladm <el...@gmail.com>.
Thanks Konstantin for your answer
   
   I am using tomcat 5.5 

   I understand your answer and tried it. Another sub - question :

   I would like the users to be able to access the "media" context with the
url : "http:domain/images/media/".
    This means I would need to somehow tell tomcat to direct all
"/images/media" request to the "media" context. Is this possible ? 

    Thank you again

Elad

   

Konstantin Kolinko wrote:
> 
>>         I have a folder in my application which I would like to deploy in
>> a
>> separate sub context. This is because it includes content media, and is
>> very
>> large to include in the "main" application "war" every time I deploy it.
> 
> You have not mentioned your Tomcat version.
> 
> That media is just a separate web application. If the main one is
> named "ROOT.war", this one is "media.war".
> 
> If you do not have a war, you can deploy an application by using a context
> file.
> 
> See
> http://tomcat.apache.org/tomcat-5.5-doc/deployer-howto.html#A%20word%20on%20Contexts
> http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
> 
>>  I am new to this list, but couldnt find anything about this topic:
> 
> Context files are discussed very often at this list. You might be able
> to find something.
> 
> Have a nice day!
> Konstantin.
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Deploying-to-a-sub-context-tf4948304.html#a14188969
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Deploying to a sub context

Posted by eladm <el...@gmail.com>.
Thanks Konstantin for your answer
   
   I am using tomcat 5.5 

   I understand your answer and tried it. Another sub - question :

   I would like the users to be able to access the "media" context with the
url : "http://[domain]/images/media/".
    This means I would need to somehow tell tomcat to direct all
"/images/media" request to the "media" context. Is this possible ? 

    Thank you again

Elad

   

Konstantin Kolinko wrote:
> 
>>         I have a folder in my application which I would like to deploy in
>> a
>> separate sub context. This is because it includes content media, and is
>> very
>> large to include in the "main" application "war" every time I deploy it.
> 
> You have not mentioned your Tomcat version.
> 
> That media is just a separate web application. If the main one is
> named "ROOT.war", this one is "media.war".
> 
> If you do not have a war, you can deploy an application by using a context
> file.
> 
> See
> http://tomcat.apache.org/tomcat-5.5-doc/deployer-howto.html#A%20word%20on%20Contexts
> http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
> 
>>  I am new to this list, but couldnt find anything about this topic:
> 
> Context files are discussed very often at this list. You might be able
> to find something.
> 
> Have a nice day!
> Konstantin.
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Deploying-to-a-sub-context-tf4948304.html#a14188969
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


Re: Deploying to a sub context

Posted by Konstantin Kolinko <kn...@gmail.com>.
>         I have a folder in my application which I would like to deploy in a
> separate sub context. This is because it includes content media, and is very
> large to include in the "main" application "war" every time I deploy it.

You have not mentioned your Tomcat version.

That media is just a separate web application. If the main one is
named "ROOT.war", this one is "media.war".

If you do not have a war, you can deploy an application by using a context file.

See
http://tomcat.apache.org/tomcat-5.5-doc/deployer-howto.html#A%20word%20on%20Contexts
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

>  I am new to this list, but couldnt find anything about this topic:

Context files are discussed very often at this list. You might be able
to find something.

Have a nice day!
Konstantin.

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