You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by kohanm <ko...@gmail.com> on 2008/07/23 22:05:15 UTC

Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Hi,

I set up the  Apache 2.2 +mod_jk +Tomcat 5.5 works fine.

I have mapping problem between  webapplication  on URL and the directory
name under webapps.

How can I configure the  content of  context file  Tomcat5.5/conf/localhost/
*webapplication.xml*   and httpd.conf file
 to map between (*webapplication*)     http://localhost/*webapplication*
/welcome.do <http://localhost/webapplication/welcome.do>
and          Tomcat5.5/webapps/*booking* directory.

 If I change the directory name  Tomcat5.5/webapps/*booking*  to the  *
webapplication,* the server works fine.


The content of context xml file on   Tomcat5.5/conf/localhost/*
webapplication.xml*:

<Context  path="/*webapplication*" docBase="*booking*"
        debug="5" reloadable="true" crossContext="true">
 ..............
</Context>


*and httpd.conf file*:(short desc)
**

LoadModule jk_module modules/mod_jk-apache-2.2.4.so


<IfModule mod_jk.c>
  JkWorkersFile conf/workers.properties
    JkLogFile logs/mod_jk.log
    JkLogLevel error
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
    JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
    JkRequestLogFormat "%w %V %T"

Alias /*webapplication * "C:/www/tomcat5/webapps/booking/"

    <Directory "C:/www/tomcat5/webapps/booking/">
        Options Indexes +FollowSymLinks
        AllowOverride None
        Allow from all
    </Directory>

 <Location /*/WEB-INF/*>
        AllowOverride None
        deny from all
    </Location>

     * JkMount /webapplication/* example*

</IfModule>



Thanks for your help.

MK
-- 
Massoud

Re: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by kohanm <ko...@gmail.com>.
Sorry you are right it's case2 or case3. Anyway I give up at this
point. I will change the link code of jsp pages with new name.
Thanks Rainer.
MK




On 7/24/08, Rainer Jung <ra...@kippdata.de> wrote:
> kohanm schrieb:
> > Thanks Rainer,
> > The probelm here is that after redirecting, the URL shows the oldapp's
> >  name but I want the url shows the newapp name.
> >
>
> Then it is not case 1 and you need to pick another case.
>
>
> > MK
> >
> >
> > On 7/24/08, Rainer Jung <ra...@kippdata.de> wrote:
> >
> > > kohanm schrieb:
> > >
> > > > Hi,
> > > > my case is Case 1:
> > > > can you give me an example for Redirect or RedirectMatch
> > > >
> > > >
> > > Simplest case:
> > >
> > > Redirect /oldapp http://myserver/newapp
> > >
> > > More details at
> > >
> > >
> http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect
> > >
> > > Regards,
> > >
> > > Rainer
> > >
> > >
> > >
> > > > thanks,
> > > >
> > > > MK
> > > >
> > > >
> > > >
> > > >
> > > > > Caldarale, Charles R schrieb:
> > > > >
> > > > >
> > > > >
> > > > > > From: kohanm [mailto:kohan.massoud@gmail.com]
> > > > > >
> > > > >
> > > >
> > > Subject: Re: Context
> > >
> > > >
> > > > >
> > > > > >
> > > > > > > or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5
> > > > > > >
> > > > > > > The webaplication is done now, but my boss asked me to change
> the
> > > > > > > name of URL webapplication. IF I change the directory name than
> > > > > > > there are many jsp pages with many links  with old name's
> > > > > > > webapplication.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > Now the true problem comes out - the webapp name is hardcoded
> within
> > > > > > the webapp; that's extremely bad practice.  I assume fixing those
> > > > > > won't be an easy task.
> > > > > >
> > > > > > In this case, you're stuck with needing to deploy the webapp in
> the
> > > > > > directory corresponding to the old name; there's no way around
> that.
> > > > > > You can write a filter or valve in Tomcat that forwards or
> redirects
> > > > > > all requests for the new name to the old one.  You should also be
> > > > > > able to do that with mod_jk directives, but someone else will have
> to
> > > > > > help with that.
> > > > > >
> > > > > >
> > > > > >
> > > > > Someone else says:
> > > > >
> > > > > If your webapp sends out responses with absolute URLs containing the
> > > > >
> > > >
> > > wrong
> > >
> > > >
> > > > > application name, then there's no easy solution.
> > > > >
> > > > > Case 1: You only want to make the app reachable under the new name,
> but
> > > > >
> > > >
> > > you
> > >
> > > >
> > > > > don't care if users switch to the old name sometime during app use.
> > > > >
> > > > > That's easy, simply redirect from the new name to the old name with
> a
> > > > > Redirect or RedirectMatch in Apache httpd.
> > > > >
> > > > > Case 2: You accept occasional occurence of the old name in THE URLs,
> but
> > > > >
> > > >
> > > it
> > >
> > > >
> > > > > should be mostly th enew one.
> > > > >
> > > > > Deploy the webapp under the new name as Charles suggested. Add a
> > > > > RewriteRule to Apache httpd to redirect any URL of the from
> > > > > /oldapp/something to /newapp/something. Whenever Users click on an
> > > > >
> > > >
> > > oldapp
> > >
> > > >
> > > > > link, the request will be answered by the redirect and the URLs
> quickly
> > > > >
> > > >
> > > get
> > >
> > > >
> > > > > replaced by the newapp URLs in the browser window. Caution: there
> might
> > > > >
> > > >
> > > be
> > >
> > > >
> > > > > problems with redirects and POST requests. All in all that's more a
> > > > >
> > > >
> > > hack.
> > >
> > > >
> > > > > Case 3: The oldapp name is not contained in the body of responses,
> but
> > > > >
> > > >
> > > only
> > >
> > > >
> > > > > used in redirects coming from the webapp. Then you could try using
> > > > > mod_proxy, which allows to change the Location headers in redirects.
> > > > >
> > > > > Case 4: You don't allow any use of the old name and the old name is
> > > > > contained in links in response bodies.
> > > > >
> > > > > Then you dynamically need to patch the responses. This will be a
> hack.
> > > > >
> > > >
> > > Have
> > >
> > > >
> > > > > a look at either mod_substitute (httpd 2.2.8 or above, I think) or
> > > > > mod_proxy_html (note: mod_proxy_html != mod_proxy_http).
> > > > >
> > > > > Regards,
> > > > >
> > > > > Rainer
> > > > >
> > > >
> > >
> >
>
> ---------------------------------------------------------------------
> 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
>
>


-- 
Massoud

---------------------------------------------------------------------
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: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by Rainer Jung <ra...@kippdata.de>.
kohanm schrieb:
> Thanks Rainer,
> The probelm here is that after redirecting, the URL shows the oldapp's
>  name but I want the url shows the newapp name.

Then it is not case 1 and you need to pick another case.

> MK
> 
> 
> On 7/24/08, Rainer Jung <ra...@kippdata.de> wrote:
>> kohanm schrieb:
>>> Hi,
>>> my case is Case 1:
>>> can you give me an example for Redirect or RedirectMatch
>>>
>> Simplest case:
>>
>> Redirect /oldapp http://myserver/newapp
>>
>> More details at
>>
>> http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect
>>
>> Regards,
>>
>> Rainer
>>
>>
>>> thanks,
>>>
>>> MK
>>>
>>>
>>>
>>>> Caldarale, Charles R schrieb:
>>>>
>>>>
>>>>> From: kohanm [mailto:kohan.massoud@gmail.com]
>> Subject: Re: Context
>>>>>> or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5
>>>>>>
>>>>>> The webaplication is done now, but my boss asked me to change the
>>>>>> name of URL webapplication. IF I change the directory name than
>>>>>> there are many jsp pages with many links  with old name's
>>>>>> webapplication.
>>>>>>
>>>>>>
>>>>> Now the true problem comes out - the webapp name is hardcoded within
>>>>> the webapp; that's extremely bad practice.  I assume fixing those
>>>>> won't be an easy task.
>>>>>
>>>>> In this case, you're stuck with needing to deploy the webapp in the
>>>>> directory corresponding to the old name; there's no way around that.
>>>>> You can write a filter or valve in Tomcat that forwards or redirects
>>>>> all requests for the new name to the old one.  You should also be
>>>>> able to do that with mod_jk directives, but someone else will have to
>>>>> help with that.
>>>>>
>>>>>
>>>> Someone else says:
>>>>
>>>> If your webapp sends out responses with absolute URLs containing the
>> wrong
>>>> application name, then there's no easy solution.
>>>>
>>>> Case 1: You only want to make the app reachable under the new name, but
>> you
>>>> don't care if users switch to the old name sometime during app use.
>>>>
>>>> That's easy, simply redirect from the new name to the old name with a
>>>> Redirect or RedirectMatch in Apache httpd.
>>>>
>>>> Case 2: You accept occasional occurence of the old name in THE URLs, but
>> it
>>>> should be mostly th enew one.
>>>>
>>>> Deploy the webapp under the new name as Charles suggested. Add a
>>>> RewriteRule to Apache httpd to redirect any URL of the from
>>>> /oldapp/something to /newapp/something. Whenever Users click on an
>> oldapp
>>>> link, the request will be answered by the redirect and the URLs quickly
>> get
>>>> replaced by the newapp URLs in the browser window. Caution: there might
>> be
>>>> problems with redirects and POST requests. All in all that's more a
>> hack.
>>>> Case 3: The oldapp name is not contained in the body of responses, but
>> only
>>>> used in redirects coming from the webapp. Then you could try using
>>>> mod_proxy, which allows to change the Location headers in redirects.
>>>>
>>>> Case 4: You don't allow any use of the old name and the old name is
>>>> contained in links in response bodies.
>>>>
>>>> Then you dynamically need to patch the responses. This will be a hack.
>> Have
>>>> a look at either mod_substitute (httpd 2.2.8 or above, I think) or
>>>> mod_proxy_html (note: mod_proxy_html != mod_proxy_http).
>>>>
>>>> Regards,
>>>>
>>>> Rainer

---------------------------------------------------------------------
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: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by kohanm <ko...@gmail.com>.
Thanks Rainer,
The probelm here is that after redirecting, the URL shows the oldapp's
 name but I want the url shows the newapp name.

MK


On 7/24/08, Rainer Jung <ra...@kippdata.de> wrote:
> kohanm schrieb:
> > Hi,
> > my case is Case 1:
> > can you give me an example for Redirect or RedirectMatch
> >
>
> Simplest case:
>
> Redirect /oldapp http://myserver/newapp
>
> More details at
>
> http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect
>
> Regards,
>
> Rainer
>
>
> > thanks,
> >
> > MK
> >
> >
> >
> > > Caldarale, Charles R schrieb:
> > >
> > >
> > > > From: kohanm [mailto:kohan.massoud@gmail.com]
> Subject: Re: Context
> > > >
> > > > > or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5
> > > > >
> > > > > The webaplication is done now, but my boss asked me to change the
> > > > > name of URL webapplication. IF I change the directory name than
> > > > > there are many jsp pages with many links  with old name's
> > > > > webapplication.
> > > > >
> > > > >
> > > > Now the true problem comes out - the webapp name is hardcoded within
> > > > the webapp; that's extremely bad practice.  I assume fixing those
> > > > won't be an easy task.
> > > >
> > > > In this case, you're stuck with needing to deploy the webapp in the
> > > > directory corresponding to the old name; there's no way around that.
> > > > You can write a filter or valve in Tomcat that forwards or redirects
> > > > all requests for the new name to the old one.  You should also be
> > > > able to do that with mod_jk directives, but someone else will have to
> > > > help with that.
> > > >
> > > >
> > > Someone else says:
> > >
> > > If your webapp sends out responses with absolute URLs containing the
> wrong
> > > application name, then there's no easy solution.
> > >
> > > Case 1: You only want to make the app reachable under the new name, but
> you
> > > don't care if users switch to the old name sometime during app use.
> > >
> > > That's easy, simply redirect from the new name to the old name with a
> > > Redirect or RedirectMatch in Apache httpd.
> > >
> > > Case 2: You accept occasional occurence of the old name in THE URLs, but
> it
> > > should be mostly th enew one.
> > >
> > > Deploy the webapp under the new name as Charles suggested. Add a
> > > RewriteRule to Apache httpd to redirect any URL of the from
> > > /oldapp/something to /newapp/something. Whenever Users click on an
> oldapp
> > > link, the request will be answered by the redirect and the URLs quickly
> get
> > > replaced by the newapp URLs in the browser window. Caution: there might
> be
> > > problems with redirects and POST requests. All in all that's more a
> hack.
> > >
> > > Case 3: The oldapp name is not contained in the body of responses, but
> only
> > > used in redirects coming from the webapp. Then you could try using
> > > mod_proxy, which allows to change the Location headers in redirects.
> > >
> > > Case 4: You don't allow any use of the old name and the old name is
> > > contained in links in response bodies.
> > >
> > > Then you dynamically need to patch the responses. This will be a hack.
> Have
> > > a look at either mod_substitute (httpd 2.2.8 or above, I think) or
> > > mod_proxy_html (note: mod_proxy_html != mod_proxy_http).
> > >
> > > Regards,
> > >
> > > Rainer
> > >
> >
>
> ---------------------------------------------------------------------
> 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
>
>


-- 
Massoud

---------------------------------------------------------------------
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: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by Rainer Jung <ra...@kippdata.de>.
kohanm schrieb:
> Hi,
> my case is Case 1:
> can you give me an example for Redirect or RedirectMatch

Simplest case:

Redirect /oldapp http://myserver/newapp

More details at

http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect

Regards,

Rainer

> thanks,
> 
> MK
> 
> 
>> Caldarale, Charles R schrieb:
>>
>>> From: kohanm [mailto:kohan.massoud@gmail.com] Subject: Re: Context
>>>> or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5
>>>>
>>>> The webaplication is done now, but my boss asked me to change the
>>>> name of URL webapplication. IF I change the directory name than
>>>> there are many jsp pages with many links  with old name's
>>>> webapplication.
>>>>
>>> Now the true problem comes out - the webapp name is hardcoded within
>>> the webapp; that's extremely bad practice.  I assume fixing those
>>> won't be an easy task.
>>>
>>> In this case, you're stuck with needing to deploy the webapp in the
>>> directory corresponding to the old name; there's no way around that.
>>> You can write a filter or valve in Tomcat that forwards or redirects
>>> all requests for the new name to the old one.  You should also be
>>> able to do that with mod_jk directives, but someone else will have to
>>> help with that.
>>>
>> Someone else says:
>>
>> If your webapp sends out responses with absolute URLs containing the wrong
>> application name, then there's no easy solution.
>>
>> Case 1: You only want to make the app reachable under the new name, but you
>> don't care if users switch to the old name sometime during app use.
>>
>> That's easy, simply redirect from the new name to the old name with a
>> Redirect or RedirectMatch in Apache httpd.
>>
>> Case 2: You accept occasional occurence of the old name in THE URLs, but it
>> should be mostly th enew one.
>>
>> Deploy the webapp under the new name as Charles suggested. Add a
>> RewriteRule to Apache httpd to redirect any URL of the from
>> /oldapp/something to /newapp/something. Whenever Users click on an oldapp
>> link, the request will be answered by the redirect and the URLs quickly get
>> replaced by the newapp URLs in the browser window. Caution: there might be
>> problems with redirects and POST requests. All in all that's more a hack.
>>
>> Case 3: The oldapp name is not contained in the body of responses, but only
>> used in redirects coming from the webapp. Then you could try using
>> mod_proxy, which allows to change the Location headers in redirects.
>>
>> Case 4: You don't allow any use of the old name and the old name is
>> contained in links in response bodies.
>>
>> Then you dynamically need to patch the responses. This will be a hack. Have
>> a look at either mod_substitute (httpd 2.2.8 or above, I think) or
>> mod_proxy_html (note: mod_proxy_html != mod_proxy_http).
>>
>> Regards,
>>
>> Rainer

---------------------------------------------------------------------
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: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by kohanm <ko...@gmail.com>.
Hi,
my case is Case 1:
can you give me an example for Redirect or RedirectMatch

thanks,

MK


> Caldarale, Charles R schrieb:
>
>> From: kohanm [mailto:kohan.massoud@gmail.com] Subject: Re: Context
>>> or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5
>>>
>>> The webaplication is done now, but my boss asked me to change the
>>> name of URL webapplication. IF I change the directory name than
>>> there are many jsp pages with many links  with old name's
>>> webapplication.
>>>
>>
>> Now the true problem comes out - the webapp name is hardcoded within
>> the webapp; that's extremely bad practice.  I assume fixing those
>> won't be an easy task.
>>
>> In this case, you're stuck with needing to deploy the webapp in the
>> directory corresponding to the old name; there's no way around that.
>> You can write a filter or valve in Tomcat that forwards or redirects
>> all requests for the new name to the old one.  You should also be
>> able to do that with mod_jk directives, but someone else will have to
>> help with that.
>>
>
> Someone else says:
>
> If your webapp sends out responses with absolute URLs containing the wrong
> application name, then there's no easy solution.
>
> Case 1: You only want to make the app reachable under the new name, but you
> don't care if users switch to the old name sometime during app use.
>
> That's easy, simply redirect from the new name to the old name with a
> Redirect or RedirectMatch in Apache httpd.
>
> Case 2: You accept occasional occurence of the old name in THE URLs, but it
> should be mostly th enew one.
>
> Deploy the webapp under the new name as Charles suggested. Add a
> RewriteRule to Apache httpd to redirect any URL of the from
> /oldapp/something to /newapp/something. Whenever Users click on an oldapp
> link, the request will be answered by the redirect and the URLs quickly get
> replaced by the newapp URLs in the browser window. Caution: there might be
> problems with redirects and POST requests. All in all that's more a hack.
>
> Case 3: The oldapp name is not contained in the body of responses, but only
> used in redirects coming from the webapp. Then you could try using
> mod_proxy, which allows to change the Location headers in redirects.
>
> Case 4: You don't allow any use of the old name and the old name is
> contained in links in response bodies.
>
> Then you dynamically need to patch the responses. This will be a hack. Have
> a look at either mod_substitute (httpd 2.2.8 or above, I think) or
> mod_proxy_html (note: mod_proxy_html != mod_proxy_http).
>
> Regards,
>
> Rainer
>
>
>
> ---------------------------------------------------------------------
> 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
>
>


-- 
Massoud

Re: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by kohanm <ko...@gmail.com>.
In my first email I copied(short)  the mod_jk configuration in httpd.conf
file.

Mk



On 7/24/08, Caldarale, Charles R <Ch...@unisys.com> wrote:
>
> > From: kohanm [mailto:kohan.massoud@gmail.com]
> > Subject: Re: Context or Mapping problems Apache 2.2 +mod_JK+
> > Tomcat 5.5
> >
> > The webaplication is done now, but my boss asked me to change the name
> > of URL webapplication. IF I change the directory name than there are
> > many jsp pages with many links  with old name's webapplication.
>
> Now the true problem comes out - the webapp name is hardcoded within the
> webapp; that's extremely bad practice.  I assume fixing those won't be an
> easy task.
>
> In this case, you're stuck with needing to deploy the webapp in the
> directory corresponding to the old name; there's no way around that.  You
> can write a filter or valve in Tomcat that forwards or redirects all
> requests for the new name to the old one.  You should also be able to do
> that with mod_jk directives, but someone else will have to help with that.
>
> - 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
>
>


-- 
Massoud

Re: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by Rainer Jung <ra...@kippdata.de>.
Caldarale, Charles R schrieb:
>> From: kohanm [mailto:kohan.massoud@gmail.com] Subject: Re: Context
>> or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5
>> 
>> The webaplication is done now, but my boss asked me to change the
>> name of URL webapplication. IF I change the directory name than
>> there are many jsp pages with many links  with old name's
>> webapplication.
> 
> Now the true problem comes out - the webapp name is hardcoded within
> the webapp; that's extremely bad practice.  I assume fixing those
> won't be an easy task.
> 
> In this case, you're stuck with needing to deploy the webapp in the
> directory corresponding to the old name; there's no way around that.
> You can write a filter or valve in Tomcat that forwards or redirects
> all requests for the new name to the old one.  You should also be
> able to do that with mod_jk directives, but someone else will have to
> help with that.

Someone else says:

If your webapp sends out responses with absolute URLs containing the 
wrong application name, then there's no easy solution.

Case 1: You only want to make the app reachable under the new name, but 
you don't care if users switch to the old name sometime during app use.

That's easy, simply redirect from the new name to the old name with a 
Redirect or RedirectMatch in Apache httpd.

Case 2: You accept occasional occurence of the old name in THE URLs, but 
it should be mostly th enew one.

Deploy the webapp under the new name as Charles suggested. Add a 
RewriteRule to Apache httpd to redirect any URL of the from 
/oldapp/something to /newapp/something. Whenever Users click on an 
oldapp link, the request will be answered by the redirect and the URLs 
quickly get replaced by the newapp URLs in the browser window. Caution: 
there might be problems with redirects and POST requests. All in all 
that's more a hack.

Case 3: The oldapp name is not contained in the body of responses, but 
only used in redirects coming from the webapp. Then you could try using 
mod_proxy, which allows to change the Location headers in redirects.

Case 4: You don't allow any use of the old name and the old name is 
contained in links in response bodies.

Then you dynamically need to patch the responses. This will be a hack. 
Have a look at either mod_substitute (httpd 2.2.8 or above, I think) or 
mod_proxy_html (note: mod_proxy_html != mod_proxy_http).

Regards,

Rainer



---------------------------------------------------------------------
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: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: kohanm [mailto:kohan.massoud@gmail.com]
> Subject: Re: Context or Mapping problems Apache 2.2 +mod_JK+
> Tomcat 5.5
>
> The webaplication is done now, but my boss asked me to change the name
> of URL webapplication. IF I change the directory name than there are
> many jsp pages with many links  with old name's webapplication.

Now the true problem comes out - the webapp name is hardcoded within the webapp; that's extremely bad practice.  I assume fixing those won't be an easy task.

In this case, you're stuck with needing to deploy the webapp in the directory corresponding to the old name; there's no way around that.  You can write a filter or valve in Tomcat that forwards or redirects all requests for the new name to the old one.  You should also be able to do that with mod_jk directives, but someone else will have to help with that.

 - 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: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by David Smith <dn...@cornell.edu>.
Then you should have written your webapp so all the links are computed 
based on the webapp's context.  In jsps you can do this with:

${pageContext.request.contextPath}/webapp/relative/path.jsp

In servlets, you can use request.getContextPath() to get the context 
path and then append your path on to it..

With that strategy, at most you'd have to alter links in static html 
files if the webapp has any.

--David

kohanm wrote:
> The webaplication is done now, but my boss asked me to change the name
> of URL webapplication. IF I change the directory name than there are
> many jsp pages with many links  with old name's webapplication.
>
> On 7/24/08, Caldarale, Charles R <Ch...@unisys.com> wrote:
>   
>>> From: kohanm [mailto:kohan.massoud@gmail.com]
>>> Subject: Re: Context or Mapping problems Apache 2.2 +mod_JK+
>>> Tomcat 5.5
>>>
>>> I want to have a webapplication name /webaplicaiton/welcome.do
>>> different than the directory name (/webapps/booking).
>>>       
>> O.k., I'll bite: why?  That's now how Tomcat is designed to work.
>>
>>     
>>> My Tomcat works if the URL is the same as directory name(or.war file).
>>>       
>> Which is as exactly how it's supposed to work.  Just use one name, and don't make things more complicated than they need to be.
>>
>>  - 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: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by kohanm <ko...@gmail.com>.
The webaplication is done now, but my boss asked me to change the name
of URL webapplication. IF I change the directory name than there are
many jsp pages with many links  with old name's webapplication.

On 7/24/08, Caldarale, Charles R <Ch...@unisys.com> wrote:
> > From: kohanm [mailto:kohan.massoud@gmail.com]
> > Subject: Re: Context or Mapping problems Apache 2.2 +mod_JK+
> > Tomcat 5.5
> >
> > I want to have a webapplication name /webaplicaiton/welcome.do
> > different than the directory name (/webapps/booking).
>
> O.k., I'll bite: why?  That's now how Tomcat is designed to work.
>
> > My Tomcat works if the URL is the same as directory name(or.war file).
>
> Which is as exactly how it's supposed to work.  Just use one name, and don't make things more complicated than they need to be.
>
>  - 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
>
>


-- 
Massoud

---------------------------------------------------------------------
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: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: kohanm [mailto:kohan.massoud@gmail.com]
> Subject: Re: Context or Mapping problems Apache 2.2 +mod_JK+
> Tomcat 5.5
>
> I want to have a webapplication name /webaplicaiton/welcome.do
> different than the directory name (/webapps/booking).

O.k., I'll bite: why?  That's now how Tomcat is designed to work.

> My Tomcat works if the URL is the same as directory name(or.war file).

Which is as exactly how it's supposed to work.  Just use one name, and don't make things more complicated than they need to be.

 - 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: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by kohanm <ko...@gmail.com>.
I think you forgot my question, I posted this question because I want
to have a  webapplication  name    /webaplicaiton/welcome.do
  different  than the directory name (/webapps/booking).
My Tomcat works if the URL is the same as directory name(or.war file).

but i want to set up the Tomcat to have  (webapplication) name
different than directory name under webapps directory

Thanks,

MK


On 7/24/08, Caldarale, Charles R <Ch...@unisys.com> wrote:
> > From: kohanm [mailto:kohan.massoud@gmail.com]
> > Subject: Re: Context or Mapping problems Apache 2.2 +mod_JK+
> > Tomcat 5.5
> >
> > The context located  :
> > Tomcat 5.5\conf\Catalina\localhost\webapplication.xml
> > and I modified as you mentioned:
> >
> > <Context         debug="5" reloadable="true" crossContext="true">
> > ---
> > </Context>
> >
> > then I tried to check the Tomcat separately with it's port:
> >  http://localhost:*8080/booking*/welcome.do*   it worked(*
> > Tomcat5.5/webapps/booking*) .*
> > **
> > and
> > http://localhost:*8080/webapplication/welcome.do<http://localh
> ost:8080/webapplication/welcome.do>
> > did not work.*
> > **
> > So I think the Tomcat does not mapping to the
> > Tomcat5.5/webapps/*booking*
> >  directory properly*.*
>
> You need to decide if your application is going to be reachable by the webapplication URI or the booking URI; choose one or the other, change the name of the <Context> .xml file to match, change the directory name (or .war file) for the application to match, and stick with *one* name.  By trying to use both, you're just creating confusion.




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



-- 
Massoud

---------------------------------------------------------------------
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: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: kohanm [mailto:kohan.massoud@gmail.com]
> Subject: Re: Context or Mapping problems Apache 2.2 +mod_JK+
> Tomcat 5.5
>
> The context located  :
> Tomcat 5.5\conf\Catalina\localhost\webapplication.xml
> and I modified as you mentioned:
>
> <Context         debug="5" reloadable="true" crossContext="true">
> ---
> </Context>
>
> then I tried to check the Tomcat separately with it's port:
>  http://localhost:*8080/booking*/welcome.do*   it worked(*
> Tomcat5.5/webapps/booking*) .*
> **
> and
> http://localhost:*8080/webapplication/welcome.do<http://localh
ost:8080/webapplication/welcome.do>
> did not work.*
> **
> So I think the Tomcat does not mapping to the
> Tomcat5.5/webapps/*booking*
>  directory properly*.*

You need to decide if your application is going to be reachable by the webapplication URI or the booking URI; choose one or the other, change the name of the <Context> .xml file to match, change the directory name (or .war file) for the application to match, and stick with *one* name.  By trying to use both, you're just creating confusion.

 - 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: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by kohanm <ko...@gmail.com>.
Hi,

The context located  :
Tomcat 5.5\conf\Catalina\localhost\webapplication.xml
and I modified as you mentioned:

<Context         debug="5" reloadable="true" crossContext="true">
---
</Context>

I tried the  http://localhost/webapplication/welcome.do  URl it did not
work.

then I tried to check the Tomcat separately with it's port:
 http://localhost:*8080/booking*/welcome.do*   it worked(*
Tomcat5.5/webapps/booking*) .*
**
and  http://localhost:*8080/webapplication/welcome.do<http://localhost:8080/webapplication/welcome.do>
did not work.*
**
So I think the Tomcat does not mapping to the  Tomcat5.5/webapps/*booking*
 directory properly*.*
Any suggestions.
Thanks.
MK





On 7/24/08, Caldarale, Charles R <Ch...@unisys.com> wrote:
> > From: kohanm [mailto:kohan.massoud@gmail.com]
> > Subject: Re: Context or Mapping problems Apache 2.2 +mod_JK+
> > Tomcat 5.5
> >
> > I removed the  path and docBase attributes like this:
> > <Context  path="" docBase=""
> >       debug="5" reloadable="true" crossContext="true">
>
> No, remove means remove, not change the values to null strings.  Your
<Context> element should simply be this:
> <Context debug="5" reloadable="true" crossContext="true">
>
> Where is your <Context> element located now?
>
> Where is your webapp deployed (name of directory or war file)?
>
> > The requested resource (/webapplication/welcome.do)
> > is not available.
>
> Verify that you can access the webapp through Tomcat's HTTP connector,
then try it through httpd.  If you can get at it directly but not through
httpd, then something's wrong with your httpd mappings, which I can't help
you with.
>
>  - 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
>
>


-- 
Massoud

RE: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: kohanm [mailto:kohan.massoud@gmail.com]
> Subject: Re: Context or Mapping problems Apache 2.2 +mod_JK+
> Tomcat 5.5
>
> I removed the  path and docBase attributes like this:
> <Context  path="" docBase=""
>       debug="5" reloadable="true" crossContext="true">

No, remove means remove, not change the values to null strings.  Your <Context> element should simply be this:
<Context debug="5" reloadable="true" crossContext="true">

Where is your <Context> element located now?

Where is your webapp deployed (name of directory or war file)?

> The requested resource (/webapplication/welcome.do)
> is not available.

Verify that you can access the webapp through Tomcat's HTTP connector, then try it through httpd.  If you can get at it directly but not through httpd, then something's wrong with your httpd mappings, which I can't help you with.

 - 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: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by kohanm <ko...@gmail.com>.
Thanks for your replay.
When  I sent the email it generated asterisks. In the context there is not
any asteriske. I do not use them. The Catalina directory name was a typo
too.

I removed the  path and docBase attributes like this:
<Context  path="" docBase=""
      debug="5" reloadable="true" crossContext="true">
**

still  does not work: (*The requested resource (/webapplication/welcome.do)
is not available.)*

Thanks,

MK

On 7/24/08, Caldarale, Charles R <Ch...@unisys.com> wrote:
>
> > From: kohanm <ko...@gmail.com>
> > Subject: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5
> >
> > If I change the directory name Tomcat5.5/webapps/*booking*
> > to the *webapplication,* the server works fine.
>
> Which is how it's supposed to work.  The URI path to the webapp is
> determined by the name of the webapp's directory or .war file.
>
> > The content of context xml file on
> > Tomcat5.5/conf/localhost/*webapplication.xml*:
>
> I'll presume the above is a typo, and should really be
> Tomcat5.5/conf/Catalina/localhost/webapplication.xml
>
> (BTW, putting asterisks in what should be verbatim configuration text only
> confuses things.)



 * *


> <Context path="/*webapplication*" docBase="*booking*"
>
> The path attribute is not allowed for this <Context> element, and the
> docBase setting conflicts with the name of the .xml file.  At best you'll be
> getting double deployment, but the behavior can not be guaranteed to be
> consistent across different Tomcat levels.
>
> Change the name of the deployment directory to webapplication, remove the
> path and docBase attributes, and it all should work.
>
> - 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
>
>


-- 
Massoud

RE: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: kohanm <ko...@gmail.com>
> Subject: Context or Mapping problems Apache 2.2 +mod_JK+ Tomcat 5.5
>
> If I change the directory name Tomcat5.5/webapps/*booking*
> to the *webapplication,* the server works fine.

Which is how it's supposed to work.  The URI path to the webapp is determined by the name of the webapp's directory or .war file.

> The content of context xml file on
> Tomcat5.5/conf/localhost/*webapplication.xml*:

I'll presume the above is a typo, and should really be
Tomcat5.5/conf/Catalina/localhost/webapplication.xml

(BTW, putting asterisks in what should be verbatim configuration text only confuses things.)

> <Context path="/*webapplication*" docBase="*booking*"

The path attribute is not allowed for this <Context> element, and the docBase setting conflicts with the name of the .xml file.  At best you'll be getting double deployment, but the behavior can not be guaranteed to be consistent across different Tomcat levels.

Change the name of the deployment directory to webapplication, remove the path and docBase attributes, and it all should work.

 - 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