You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rina Shilo <ri...@checkm8.com> on 2004/02/26 07:50:24 UTC

how to define duplicate context in Tomcat (server.xml)

I want to duplicate my service that run under tomcat so I'll have it twice
on my web server under 2 different names.
(since I need 1 service running, and the second to be a test service).
My tomcat service include JS, JSP, Classes.

How to configure the tomcat to start both services?

I tried already to define it as new context in the same service in the
server.xml - and it's not worked.
I tried already to define it as new context in a new service tag in the
server.xml - and it's not worked.
Just one of them work, the second failed. seems to me its because they
include similar classes file/name.

this is how it look like:

 <Host name="Service" debug="0" appBase=""
  unpackWARs="true" autoDeploy="true">


        <Valve className="org.apache.catalina.valves.AccessLogValve"
                 directory="c:/Program Files/Logs"  prefix="tomcat_access."
suffix=".log"
                 pattern="common" resolveHosts="false"/>

 <Context path="/A" docBase="c:\Program Files\A" crossContext="false"
debug="0" reloadable="false" />
 <Context path="/B" docBase="c:\Program Files\B" crossContext="false"
debug="0" reloadable="false" />


        </Host>
can someone help me in this?

===========================


Re: how to define duplicate context in Tomcat (server.xml)

Posted by Milt Epstein <me...@uiuc.edu>.
On Thu, 26 Feb 2004, Rina Shilo wrote:

> I want to duplicate my service that run under tomcat so I'll have it
> twice on my web server under 2 different names.  (since I need 1
> service running, and the second to be a test service).  My tomcat
> service include JS, JSP, Classes.
>
> How to configure the tomcat to start both services?
>
> I tried already to define it as new context in the same service in
> the server.xml - and it's not worked.
> I tried already to define it as new context in a new service tag in
> the server.xml - and it's not worked.
> Just one of them work, the second failed. seems to me its because
> they include similar classes file/name.

In theory, I believe, you should be able to get either one to work.
But maybe you have some of the details wrong.  Without more info, like
what config you tried, and what error(s) you got, it's hard to tell
what's wrong.

Also note that depending on what version of Tomcat you are using,
placing Context tags directly in server.xml may not be the proper way
to do it.  Other options include just placing the subdirectories under
webapps so they will get picked up automatically, or placing context
configuration files (which include only the Context tag) in the
appropriate location under <tomcat>/conf (i.e.,
<tomcat>/conf/<engine>/<host>).


> this is how it look like:
>
>  <Host name="Service" debug="0" appBase=""
>   unpackWARs="true" autoDeploy="true">
>
>
>         <Valve className="org.apache.catalina.valves.AccessLogValve"
>                  directory="c:/Program Files/Logs"  prefix="tomcat_access."
> suffix=".log"
>                  pattern="common" resolveHosts="false"/>
>
>  <Context path="/A" docBase="c:\Program Files\A" crossContext="false"
> debug="0" reloadable="false" />
>  <Context path="/B" docBase="c:\Program Files\B" crossContext="false"
> debug="0" reloadable="false" />
>
>
>         </Host>
> can someone help me in this?
>
> ===========================
>
>

Milt Epstein
Research Programmer
Integration and Software Engineering (ISE)
Campus Information Technologies and Educational Services (CITES)
University of Illinois at Urbana-Champaign (UIUC)
mepstein@uiuc.edu

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