List Info

Thread: Selectively forward trafic from Apache to Tomcat




Selectively forward trafic from Apache to Tomcat
user name
2006-11-29 14:39:13
Hi all,
 
  Trafic from a rich client consists of requests for static ressources
like *.png and requests for dynamicaly generated templates.
  
  Requests like this:
  http://localhost/project/com/project/imgs*.png would retrieve the
files from the filesystem where apache runs and
  
  http://localhost/project/com/project/dynamic/Templ.xml would be
forwarded to Tomcat which and will bring back a dynamicaly generated
XML
stream
  with xml/mime type.
  
  Please help me configure Apache to resolve both
  situations when one path is a subfolder to the other.
  
  Thank you in advance.

Send instant messages to your online friends http://uk.messenger.yahoo.com

Selectively forward trafic from Apache to Tomcat
user name
2006-11-29 16:46:32
http://tomca
t.apache.org/connectors-doc/

cheers

Greg
-- 
what's puzzlin' you, is the nature of my game

------------------------------------------------------------
---------
The official User-To-User support forum of the Apache HTTP
Server Project.
See <URL:http://htt
pd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribehttpd.apache.org
   "   from the digest: users-digest-unsubscribehttpd.apache.org
For additional commands, e-mail: users-helphttpd.apache.org

Selectively forward trafic from Apache to Tomcat
user name
2006-11-29 16:48:26
I think you could do that via mod_rewrite

RewriteRule ^/project/(.*)/dynamic/(.*)
http://tomcat/project/$1/d
ynamic/$2 [proxy,last]

RewriteRule ^/project/(.*)
http://apache/project/$1  
    [passthrough,last]

You also need to define a <Directory or <Location for
your local
static files on Apache

>   Requests like this:
>   http:/
/localhost/project/com/project/imgs*.png would
> retrieve the
> files from the filesystem where apache runs and
>
>   http://localhost/project/com/project/dynamic/Templ.xml
> would be
> forwarded to Tomcat which and will bring back a
dynamicaly generated
> XML
> stream
>   with xml/mime type.

------------------------------------------------------------
---------
The official User-To-User support forum of the Apache HTTP
Server Project.
See <URL:http://htt
pd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribehttpd.apache.org
   "   from the digest: users-digest-unsubscribehttpd.apache.org
For additional commands, e-mail: users-helphttpd.apache.org

Selectively forward trafic from Apache to Tomcat
user name
2006-11-29 16:52:22
This wont work.

Ian asked if both (Apache & Tomcat) could be configured
to listen on
the same port, and the anser here is definately a NO.

What you can do is use the connector JK 1.2, run Apache in
front,
Tomcat on port i.e. 8009. JK then will forward the specified
requests
to Tomcat, similar to a proxy.

Your solution might work also, however, Tomcat won't
"run" on the same
port as Apache.

Cheers

Greg
-- 
what's puzzlin' you, is the nature of my game

------------------------------------------------------------
---------
The official User-To-User support forum of the Apache HTTP
Server Project.
See <URL:http://htt
pd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribehttpd.apache.org
   "   from the digest: users-digest-unsubscribehttpd.apache.org
For additional commands, e-mail: users-helphttpd.apache.org

Selectively forward trafic from Apache to Tomcat
user name
2006-11-29 16:55:15
Forgot to mention that Ian asked in the Tomcat-userlist if
he could
run both on the same port (check for the post "Can
Apache and Tomcat
both be configured in port 80?")

Sorry, forgot to mention that

Greg
-- 
what's puzzlin' you, is the nature of my game

------------------------------------------------------------
---------
The official User-To-User support forum of the Apache HTTP
Server Project.
See <URL:http://htt
pd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribehttpd.apache.org
   "   from the digest: users-digest-unsubscribehttpd.apache.org
For additional commands, e-mail: users-helphttpd.apache.org

Selectively forward trafic from Apache to Tomcat
user name
2006-11-29 16:59:24
Forgive me, I was mixing up 2 threads, sorry 4 that.

Maybe it's time to call it a day.

Sorry again

Greg
-- 
what's puzzlin' you, is the nature of my game

------------------------------------------------------------
---------
The official User-To-User support forum of the Apache HTTP
Server Project.
See <URL:http://htt
pd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribehttpd.apache.org
   "   from the digest: users-digest-unsubscribehttpd.apache.org
For additional commands, e-mail: users-helphttpd.apache.org

[1-6]

about | contact  Other archives ( Real Estate discussion Medical topics )