You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by abhishek jain <ab...@gmail.com> on 2010/06/25 08:46:59 UTC

Two applications, one in a sub folder - Urgent help needed

Dear friends,
I have a website in Struts 1.2 and i want to install another Struts
application made by me, in a subfolder of the website. I don't know will
this work,
Both are struts 1.2 applications.
I am using apache 2.x and  Tomcat 5, on Cpanel , linux centos 5.5.

I think one of the possible sol might be mapping the location tag in
httpd.conf to diff webapp , i dont know how to do so.

Pl. help,
-- 
Thanks and kind Regards,
Abhishek jain

RE: Two applications, one in a sub folder - Urgent help needed

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Paweł Zuzelski [mailto:z@xatka.net]
> Subject: Re: Two applications, one in a sub folder - Urgent help needed
> 
> app.xml should be something like:
> <?xml version="1.0" encoding="UTF-8"?>
> <Context path="/app" docBase="/usr/local/share/app1" privileged="false"
> allowLinking="true">
> </Context>
> 
> app#subapp.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <Context path="/app/subapp" docBase="/usr/local/share/app2"
> privileged="false" allowLinking="true">
> </Context>
> 
> Note that “path” attribute must match xml context file name (note:
> '/' becomes '#' in filename)

Actually, the path attribute must be removed - it's not allowed here.  The path is derived from the name of the .xml file.

Otherwise, the above configuration is exactly what the OP needs, and seems to be studiously avoiding.

 - 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.


Re: Two applications, one in a sub folder - Urgent help needed

Posted by Pid <pi...@pidster.com>.
On 25/06/2010 11:56, Mark Thomas wrote:
> On 25/06/2010 11:50, Pid wrote:
>> On 25/06/2010 11:46, abhishek jain wrote:
>>> hi
>>> thanks for the email,
>>> but the path is like
>>>   /usr/local/share/apps
>>>
>>> and for the second application:
>>>
>>>   /usr/local/share/apps/app2
>>>
>>> i mean it is a subfolder.
>>>
>>> will this still work?
>>
>> Depends which Tomcat version you actually have.  I don't think
>> multilevel paths are supported in 5.0.n, (but I might be wrong).
> 
> It isn't (but that doesn't matter). Overlapping values for docBase are
> never valid. This configuration cannot work.

Ah yes.  Fail.


p


> Mark
> 
>>
>>
>> p
>>
>>> 2010/6/25 Paweł Zuzelski <z...@xatka.net>
>>>
>>>> No, it is not „Urgent” for anyone but you. If you one it to be
>>>> urgent for anyone else, pay for it :)
>>>>
>>>>> Dear friends,
>>>>> I have a website in Struts 1.2 and i want to install another Struts
>>>>> application made by me, in a subfolder of the website. I don't know will
>>>>> this work,
>>>>> Both are struts 1.2 applications.
>>>>> I am using apache 2.x and  Tomcat 5, on Cpanel , linux centos 5.5.
>>>>
>>>> I would define context of these applications explicite in Catalina
>>>> config. I mean:
>>>>
>>>> unpack your war files into some directories, let say:
>>>>   /usr/local/share/app1
>>>>   /usr/local/share/app2
>>>>
>>>> then create files
>>>>
>>>> (home_of_your_tomcat_installation)/tomcat/conf/Catalina/localhost/app.xml
>>>>
>>>> (home_of_your_tomcat_installation)/tomcat/conf/Catalina/localhost/app#subapp.xml
>>>>
>>>> app.xml should be something like:
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <Context path="/app" docBase="/usr/local/share/app1" privileged="false"
>>>> allowLinking="true">
>>>> </Context>
>>>>
>>>> app#subapp.xml:
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <Context path="/app/subapp" docBase="/usr/local/share/app2"
>>>> privileged="false" allowLinking="true">
>>>> </Context>
>>>>
>>>> Note that “path” attribute must match xml context file name (note:
>>>> '/' becomes '#' in filename)
>>>>
>>>> Hope it helps.
>>>>
>>>
>>
>>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 



Re: Two applications, one in a sub folder - Urgent help needed

Posted by Pid <pi...@pidster.com>.
On 25/06/2010 12:27, abhishek jain wrote:
> On Fri, Jun 25, 2010 at 4:51 PM, Mark Thomas <ma...@apache.org> wrote:
> 
>> On 25/06/2010 12:19, Pid wrote:
>>> On 25/06/2010 12:02, abhishek jain wrote:
>>>> On Fri, Jun 25, 2010 at 4:26 PM, Mark Thomas <ma...@apache.org> wrote:
>>>>
>>>>> On 25/06/2010 11:50, Pid wrote:
>>>>>> On 25/06/2010 11:46, abhishek jain wrote:
>>>>>>> hi
>>>>>>> thanks for the email,
>>>>>>> but the path is like
>>>>>>>   /usr/local/share/apps
>>>>>>>
>>>>>>> and for the second application:
>>>>>>>
>>>>>>>   /usr/local/share/apps/app2
>>>>>>>
>>>>>>> i mean it is a subfolder.
>>>>>>>
>>>>>>> will this still work?
>>>>>>
>>>>>> Depends which Tomcat version you actually have.  I don't think
>>>>>> multilevel paths are supported in 5.0.n, (but I might be wrong).
>>>>>
>>>>> It isn't (but that doesn't matter). Overlapping values for docBase are
>>>>> never valid. This configuration cannot work.
>>>>>
>>>>>
>>>> but are the overlapping values of context path valid, ?
>>>
>>> Depends on which version of Tomcat you have.
>>
>> Actually, overlapping context paths are always valid. Consider:
>> /
>> and
>> /docs
>>
>>> And whether you've configured it correctly.
>>
>> +1. Especially if you want /my/context/path
>>
>> Correct varies by version.
>>
>>
> 
> 
> 
> I am using tomcat 5.5 and cpanel is configuring it,
> but i think for this configuration i will have to go to file server.xml and
> add the additional  context path row in the xml , something like:
> 
> <Host name="xxxxxxxxxxx" appBase="/home/xxxxxxxxxxx/public_html">

appBase should not equal docBase.

>           <Alias>xxxxxxx</Alias>
> *          <Context path="" reloadable="true" docBase="/xxxxx/public_html"
> debug="1"/>

see above.

>           <Context path="/subfolder" reloadable="true"
> docBase="/yyyyyyyy/public_html" debug="1"/>

That's just the same docBase again.

> *          <Context path="/manager" debug="0" privileged="true"
>               docBase="/usr/local/jakarta/tomcat/server/webapps/manager">
>           </Context>
>        </Host>
> 
> is this the right way?


Let's start over.

Exactly which version: 5.5.what?

... and which JVM version; also are you using HTTPD & mod_jk in front of
Tomcat - if so, what versions are they?


p





Re: Two applications, one in a sub folder - Urgent help needed

Posted by abhishek jain <ab...@gmail.com>.
On Fri, Jun 25, 2010 at 4:51 PM, Mark Thomas <ma...@apache.org> wrote:

> On 25/06/2010 12:19, Pid wrote:
> > On 25/06/2010 12:02, abhishek jain wrote:
> >> On Fri, Jun 25, 2010 at 4:26 PM, Mark Thomas <ma...@apache.org> wrote:
> >>
> >>> On 25/06/2010 11:50, Pid wrote:
> >>>> On 25/06/2010 11:46, abhishek jain wrote:
> >>>>> hi
> >>>>> thanks for the email,
> >>>>> but the path is like
> >>>>>   /usr/local/share/apps
> >>>>>
> >>>>> and for the second application:
> >>>>>
> >>>>>   /usr/local/share/apps/app2
> >>>>>
> >>>>> i mean it is a subfolder.
> >>>>>
> >>>>> will this still work?
> >>>>
> >>>> Depends which Tomcat version you actually have.  I don't think
> >>>> multilevel paths are supported in 5.0.n, (but I might be wrong).
> >>>
> >>> It isn't (but that doesn't matter). Overlapping values for docBase are
> >>> never valid. This configuration cannot work.
> >>>
> >>>
> >> but are the overlapping values of context path valid, ?
> >
> > Depends on which version of Tomcat you have.
>
> Actually, overlapping context paths are always valid. Consider:
> /
> and
> /docs
>
> > And whether you've configured it correctly.
>
> +1. Especially if you want /my/context/path
>
> Correct varies by version.
>
>



I am using tomcat 5.5 and cpanel is configuring it,
but i think for this configuration i will have to go to file server.xml and
add the additional  context path row in the xml , something like:

<Host name="xxxxxxxxxxx" appBase="/home/xxxxxxxxxxx/public_html">
          <Alias>xxxxxxx</Alias>
*          <Context path="" reloadable="true" docBase="/xxxxx/public_html"
debug="1"/>
          <Context path="/subfolder" reloadable="true"
docBase="/yyyyyyyy/public_html" debug="1"/>
*          <Context path="/manager" debug="0" privileged="true"
              docBase="/usr/local/jakarta/tomcat/server/webapps/manager">
          </Context>
       </Host>

is this the right way?

-- 
Thanks and kind Regards,
Abhishek jain

Re: Two applications, one in a sub folder - Urgent help needed

Posted by Mark Thomas <ma...@apache.org>.
On 25/06/2010 12:19, Pid wrote:
> On 25/06/2010 12:02, abhishek jain wrote:
>> On Fri, Jun 25, 2010 at 4:26 PM, Mark Thomas <ma...@apache.org> wrote:
>>
>>> On 25/06/2010 11:50, Pid wrote:
>>>> On 25/06/2010 11:46, abhishek jain wrote:
>>>>> hi
>>>>> thanks for the email,
>>>>> but the path is like
>>>>>   /usr/local/share/apps
>>>>>
>>>>> and for the second application:
>>>>>
>>>>>   /usr/local/share/apps/app2
>>>>>
>>>>> i mean it is a subfolder.
>>>>>
>>>>> will this still work?
>>>>
>>>> Depends which Tomcat version you actually have.  I don't think
>>>> multilevel paths are supported in 5.0.n, (but I might be wrong).
>>>
>>> It isn't (but that doesn't matter). Overlapping values for docBase are
>>> never valid. This configuration cannot work.
>>>
>>>
>> but are the overlapping values of context path valid, ?
> 
> Depends on which version of Tomcat you have.

Actually, overlapping context paths are always valid. Consider:
/
and
/docs

> And whether you've configured it correctly.

+1. Especially if you want /my/context/path

Correct varies by version.

Mark



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


Re: Two applications, one in a sub folder - Urgent help needed

Posted by Pid <pi...@pidster.com>.
On 25/06/2010 12:02, abhishek jain wrote:
> On Fri, Jun 25, 2010 at 4:26 PM, Mark Thomas <ma...@apache.org> wrote:
> 
>> On 25/06/2010 11:50, Pid wrote:
>>> On 25/06/2010 11:46, abhishek jain wrote:
>>>> hi
>>>> thanks for the email,
>>>> but the path is like
>>>>   /usr/local/share/apps
>>>>
>>>> and for the second application:
>>>>
>>>>   /usr/local/share/apps/app2
>>>>
>>>> i mean it is a subfolder.
>>>>
>>>> will this still work?
>>>
>>> Depends which Tomcat version you actually have.  I don't think
>>> multilevel paths are supported in 5.0.n, (but I might be wrong).
>>
>> It isn't (but that doesn't matter). Overlapping values for docBase are
>> never valid. This configuration cannot work.
>>
>>
> but are the overlapping values of context path valid, ?

Depends on which version of Tomcat you have.
And whether you've configured it correctly.


p

> - abhi
> 



Re: Two applications, one in a sub folder - Urgent help needed

Posted by abhishek jain <ab...@gmail.com>.
On Fri, Jun 25, 2010 at 4:26 PM, Mark Thomas <ma...@apache.org> wrote:

> On 25/06/2010 11:50, Pid wrote:
> > On 25/06/2010 11:46, abhishek jain wrote:
> >> hi
> >> thanks for the email,
> >> but the path is like
> >>   /usr/local/share/apps
> >>
> >> and for the second application:
> >>
> >>   /usr/local/share/apps/app2
> >>
> >> i mean it is a subfolder.
> >>
> >> will this still work?
> >
> > Depends which Tomcat version you actually have.  I don't think
> > multilevel paths are supported in 5.0.n, (but I might be wrong).
>
> It isn't (but that doesn't matter). Overlapping values for docBase are
> never valid. This configuration cannot work.
>
>
but are the overlapping values of context path valid, ?

- abhi

Re: Two applications, one in a sub folder - Urgent help needed

Posted by Mark Thomas <ma...@apache.org>.
On 25/06/2010 11:50, Pid wrote:
> On 25/06/2010 11:46, abhishek jain wrote:
>> hi
>> thanks for the email,
>> but the path is like
>>   /usr/local/share/apps
>>
>> and for the second application:
>>
>>   /usr/local/share/apps/app2
>>
>> i mean it is a subfolder.
>>
>> will this still work?
> 
> Depends which Tomcat version you actually have.  I don't think
> multilevel paths are supported in 5.0.n, (but I might be wrong).

It isn't (but that doesn't matter). Overlapping values for docBase are
never valid. This configuration cannot work.

Mark

> 
> 
> p
> 
>> 2010/6/25 Paweł Zuzelski <z...@xatka.net>
>>
>>> No, it is not „Urgent” for anyone but you. If you one it to be
>>> urgent for anyone else, pay for it :)
>>>
>>>> Dear friends,
>>>> I have a website in Struts 1.2 and i want to install another Struts
>>>> application made by me, in a subfolder of the website. I don't know will
>>>> this work,
>>>> Both are struts 1.2 applications.
>>>> I am using apache 2.x and  Tomcat 5, on Cpanel , linux centos 5.5.
>>>
>>> I would define context of these applications explicite in Catalina
>>> config. I mean:
>>>
>>> unpack your war files into some directories, let say:
>>>   /usr/local/share/app1
>>>   /usr/local/share/app2
>>>
>>> then create files
>>>
>>> (home_of_your_tomcat_installation)/tomcat/conf/Catalina/localhost/app.xml
>>>
>>> (home_of_your_tomcat_installation)/tomcat/conf/Catalina/localhost/app#subapp.xml
>>>
>>> app.xml should be something like:
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <Context path="/app" docBase="/usr/local/share/app1" privileged="false"
>>> allowLinking="true">
>>> </Context>
>>>
>>> app#subapp.xml:
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <Context path="/app/subapp" docBase="/usr/local/share/app2"
>>> privileged="false" allowLinking="true">
>>> </Context>
>>>
>>> Note that “path” attribute must match xml context file name (note:
>>> '/' becomes '#' in filename)
>>>
>>> Hope it helps.
>>>
>>
> 
> 




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


Re: Two applications, one in a sub folder - Urgent help needed

Posted by Pid <pi...@pidster.com>.
On 25/06/2010 11:46, abhishek jain wrote:
> hi
> thanks for the email,
> but the path is like
>   /usr/local/share/apps
> 
> and for the second application:
> 
>   /usr/local/share/apps/app2
> 
> i mean it is a subfolder.
> 
> will this still work?

Depends which Tomcat version you actually have.  I don't think
multilevel paths are supported in 5.0.n, (but I might be wrong).


p

> 2010/6/25 Paweł Zuzelski <z...@xatka.net>
> 
>> No, it is not „Urgent” for anyone but you. If you one it to be
>> urgent for anyone else, pay for it :)
>>
>>> Dear friends,
>>> I have a website in Struts 1.2 and i want to install another Struts
>>> application made by me, in a subfolder of the website. I don't know will
>>> this work,
>>> Both are struts 1.2 applications.
>>> I am using apache 2.x and  Tomcat 5, on Cpanel , linux centos 5.5.
>>
>> I would define context of these applications explicite in Catalina
>> config. I mean:
>>
>> unpack your war files into some directories, let say:
>>   /usr/local/share/app1
>>   /usr/local/share/app2
>>
>> then create files
>>
>> (home_of_your_tomcat_installation)/tomcat/conf/Catalina/localhost/app.xml
>>
>> (home_of_your_tomcat_installation)/tomcat/conf/Catalina/localhost/app#subapp.xml
>>
>> app.xml should be something like:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <Context path="/app" docBase="/usr/local/share/app1" privileged="false"
>> allowLinking="true">
>> </Context>
>>
>> app#subapp.xml:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <Context path="/app/subapp" docBase="/usr/local/share/app2"
>> privileged="false" allowLinking="true">
>> </Context>
>>
>> Note that “path” attribute must match xml context file name (note:
>> '/' becomes '#' in filename)
>>
>> Hope it helps.
>>
> 



Re: Two applications, one in a sub folder - Urgent help needed

Posted by abhishek jain <ab...@gmail.com>.
On Fri, Jun 25, 2010 at 4:16 PM, abhishek jain
<ab...@gmail.com>wrote:

> hi
> thanks for the email,
> but the path is like
>   /usr/local/share/apps
>
> and for the second application:
>
>   /usr/local/share/apps/app2
>
> i mean it is a subfolder.
>
> sorry i think you are right i will give it a try.
please , ignore previous email.


> will this still work?
>
> 2010/6/25 Paweł Zuzelski <z...@xatka.net>
>
> No, it is not „Urgent” for anyone but you. If you one it to be
>> urgent for anyone else, pay for it :)
>>
>> > Dear friends,
>> > I have a website in Struts 1.2 and i want to install another Struts
>> > application made by me, in a subfolder of the website. I don't know will
>> > this work,
>> > Both are struts 1.2 applications.
>> > I am using apache 2.x and  Tomcat 5, on Cpanel , linux centos 5.5.
>>
>> I would define context of these applications explicite in Catalina
>> config. I mean:
>>
>> unpack your war files into some directories, let say:
>>   /usr/local/share/app1
>>   /usr/local/share/app2
>>
>> then create files
>>
>> (home_of_your_tomcat_installation)/tomcat/conf/Catalina/localhost/app.xml
>>
>> (home_of_your_tomcat_installation)/tomcat/conf/Catalina/localhost/app#subapp.xml
>>
>> app.xml should be something like:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <Context path="/app" docBase="/usr/local/share/app1" privileged="false"
>> allowLinking="true">
>> </Context>
>>
>> app#subapp.xml:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <Context path="/app/subapp" docBase="/usr/local/share/app2"
>> privileged="false" allowLinking="true">
>> </Context>
>>
>> Note that “path” attribute must match xml context file name (note:
>> '/' becomes '#' in filename)
>>
>> Hope it helps.
>>
>
>
>

Please ignore previous email
- abhi

Re: Two applications, one in a sub folder - Urgent help needed

Posted by abhishek jain <ab...@gmail.com>.
hi
thanks for the email,
but the path is like
  /usr/local/share/apps

and for the second application:

  /usr/local/share/apps/app2

i mean it is a subfolder.

will this still work?

2010/6/25 Paweł Zuzelski <z...@xatka.net>

> No, it is not „Urgent” for anyone but you. If you one it to be
> urgent for anyone else, pay for it :)
>
> > Dear friends,
> > I have a website in Struts 1.2 and i want to install another Struts
> > application made by me, in a subfolder of the website. I don't know will
> > this work,
> > Both are struts 1.2 applications.
> > I am using apache 2.x and  Tomcat 5, on Cpanel , linux centos 5.5.
>
> I would define context of these applications explicite in Catalina
> config. I mean:
>
> unpack your war files into some directories, let say:
>   /usr/local/share/app1
>   /usr/local/share/app2
>
> then create files
>
> (home_of_your_tomcat_installation)/tomcat/conf/Catalina/localhost/app.xml
>
> (home_of_your_tomcat_installation)/tomcat/conf/Catalina/localhost/app#subapp.xml
>
> app.xml should be something like:
> <?xml version="1.0" encoding="UTF-8"?>
> <Context path="/app" docBase="/usr/local/share/app1" privileged="false"
> allowLinking="true">
> </Context>
>
> app#subapp.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <Context path="/app/subapp" docBase="/usr/local/share/app2"
> privileged="false" allowLinking="true">
> </Context>
>
> Note that “path” attribute must match xml context file name (note:
> '/' becomes '#' in filename)
>
> Hope it helps.
>

-- 
Thanks and kind Regards,
Abhishek jain

Re: Two applications, one in a sub folder - Urgent help needed

Posted by Paweł Zuzelski <z...@xatka.net>.
No, it is not „Urgent” for anyone but you. If you one it to be
urgent for anyone else, pay for it :)

> Dear friends,
> I have a website in Struts 1.2 and i want to install another Struts
> application made by me, in a subfolder of the website. I don't know will
> this work,
> Both are struts 1.2 applications.
> I am using apache 2.x and  Tomcat 5, on Cpanel , linux centos 5.5.

I would define context of these applications explicite in Catalina
config. I mean:

unpack your war files into some directories, let say:
   /usr/local/share/app1
   /usr/local/share/app2

then create files

(home_of_your_tomcat_installation)/tomcat/conf/Catalina/localhost/app.xml
(home_of_your_tomcat_installation)/tomcat/conf/Catalina/localhost/app#subapp.xml

app.xml should be something like:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/app" docBase="/usr/local/share/app1" privileged="false" allowLinking="true">
</Context>

app#subapp.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Context path="/app/subapp" docBase="/usr/local/share/app2" privileged="false" allowLinking="true">
</Context>

Note that “path” attribute must match xml context file name (note:
'/' becomes '#' in filename)

Hope it helps.

> I think one of the possible sol might be mapping the location tag in
> httpd.conf to diff webapp , i dont know how to do so.

IMO it's better to configure it at tomcat level.

-- 
Regards,
Paweł Zuzelski

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