Melanie Pfefer schrieb:
all I want is to redirect from apache to tomcat. That
I was able to do using rewrite rule
however, I want the redirection to be transparent (no
changes in url) so i thought of using P flag.
We should get terminology straight:
- redirect: change the URL and sent a 30X response back to the browser,
indicating that the browser should instead make a new request to this
changed URL. Browsers will handle redirects automatically, but the new
URL will be visible to the users (and get used in bookmarks etc.)
- rewrite: internally rewrite a URL during processing without making the
client aware of this.
- forward (in the sense of a reverse proxy): sending a request received
by a server to another server and returning the response gotten from
that server back to the client.
Caution: mod_rewrite can do redirect and rewrite and also interacts with
forwarding.
I guess what you want is a combination of rewrite and forward: The
client uses a URL which does not exist on the final server and you want
to use an intermediate server to change this URL (rewrite) to the one
known on the final server, sending the resulting request there and
returning the final response back to the client.
The components you perfer to do this with are Tomcat as the final server
(backend) and Apache httpd to rewrite and forward.
You can do the forwarding either with mod_jk or mod_proxy. You should
have a working forwarding before getting into the rewrite business.
To do the rewrite, you use a RewriteRule with mod_rewrite and you need
to add the pass through "PT" flag to let further modules (in the case of
mod_jk) participate in request processing. The flag is important.
See "passthrough" in http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html.
HTH
Rainer
if ur method can do this please share how to do it.
thanks
--- ChrisS <[EMAIL PROTECTED]> wrote:
I worked with Solaris 10's apache and found that I
had to download the
apache source code eventually and rebuild it myself.
I found a few bugs in
2.2.8's configure scripts, what I am using now but I
got it to work, if you
are up for it I could help out!
I never used the P proxy flag in httpd.conf, I used
jk_mod.1.2.6 (but this
is jk_mod.1.2.7 really) then to get apache to
communicate with the tomcat
nodes I set up a worker file included it in
httpd.conf, that with the jk_mod
included in httpd's module section and I was
accessing Tomcat through two
worker ports set up in apache. Is this what you are
trying to do?
Chris S
----- Original Message -----
From: "Melanie Pfefer" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Thursday, March 27, 2008 4:23 PM
Subject: Re: RES: url redirection
Hello
Actually I was able to define a rewrite rule in
apache:
RewriteRule ^/(.*web:jar.*)
http://zeus:8086/src/$1
[R=301,L]
now
http://zeus/web:jar:0000001
redirects to
http://zeus:8086/src/web:jar:0000001
But if I tried to change the flag to P (proxy) in
httpd.conf
the apache error file gives:
[Thu Mar 27 17:18:58 2008] [error] [client
172.21.194.71] File does not exist:
/usr/local/apache2/htdocs/src, referer:
http://zeus/web:jar:0000001
the tomcat gives:
Your request is:
http://zeus:8086/src/web:jar:0000001
Patj info is: web:jar:0000001
Session (1A578677550D1A75793540B152A8D6B6) has
been
added to the list of valid Sessions
MY path info in treeview is: web:jar:0000001
I suspect I should something on tomcat to all this
operation. right?
I am using Solaris 10 - apache 2.2.4 and tomcat 6
--- ChrisS <[EMAIL PROTECTED]>
wrote:
Melanie are you using FreeBSD or OpenBSD? I am
going
back a bit but I
remember using Zeus on OpenBSD.
The way I set up clustering recently was through
a
workers.properties file
which I stored in the apache/conf subdirectory.
To
start with you have to
make sure all the prerequisites are in place. If
you
are using a version of
Apache that supports it you need to DSO the
mod_jk
module into this (if you
haven't done this already) with
"./configure
--with-apxs=/usr/local/apache/bin/apxs". This
won't
work unless
you have mod_ssl installed !make sure the version
you have supports it!. For
example if you are using an APACI version, you
may
face problems. If you do
have mod_ssl installed and are witnessing
problems
note the error whilst
trying to launch Apache. I witnessed numerous
errors
whilst trying to build
1.3.39, 1.3.4, 2.0.x 2.2.x this way.
----- Original Message -----
From: "Melanie Pfefer"
<[EMAIL PROTECTED]>
To: "Tomcat Users List" <users@tomcat.apache.org>
Sent: Thursday, March 27, 2008 12:31 PM
Subject: Re: RES: url redirection
Hi,
thanks for your reply. what I want is to
redirect
http://zeus:8085/web/sec:jar:0000001
to
http://zeus:8086/src/web:sec:jar:0000001
The first one is on apache
the 2nd one is on tomcat
thanks again
--- "Milanez, Marcus"
<[EMAIL PROTECTED]>
wrote:
Hi,
I'm not completely sure about what you want,
but
you
can redirect urls according to a given pattern
between tomcat instances using jakarta
connectors.
Is that what you want? You can have further
info
here http://tomcat.apache.org/connectors-doc/
Yours,
Marcus
-----Mensagem original-----
De: Melanie Pfefer
[mailto:[EMAIL PROTECTED]
Enviada em: quinta-feira, 27 de março de 2008
07:32
Para: users@tomcat.apache.org
Assunto: url redirection
Hi,
I have 2 web apps deployed on 2 tomcat
servers.
How
to redirect urls that contains 'jar' string
from
one
app to another?
http://zeus:8085/web/sec:jar:0000001
to
http://zeus:8086/src/web:sec:jar:0000001
thanks
__________________________________________________________
Sent from Yahoo! Mail.
More Ways to Keep in Touch.
http://uk.docs.yahoo.com/nowyoucan.html
---------------------------------------------------------------------
To start a new topic, e-mail:
users@tomcat.apache.org To unsubscribe,
e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail:
=== message truncated ===
__________________________________________________________
Sent from Yahoo! Mail.
More Ways to Keep in Touch. http://uk.docs.yahoo.com/nowyoucan.html
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]