You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ian Coal <ic...@talk21.com> on 2006/11/29 15:39:13 UTC

[users@httpd] Selectively forward trafic from Apache to Tomcat

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 

Re: [users@httpd] Selectively forward trafic from Apache to Tomcat

Posted by Gregor Schneider <rc...@googlemail.com>.
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://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Selectively forward trafic from Apache to Tomcat

Posted by Gregor Schneider <rc...@googlemail.com>.
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://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Selectively forward trafic from Apache to Tomcat

Posted by Gregor Schneider <rc...@googlemail.com>.
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://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Selectively forward trafic from Apache to Tomcat

Posted by toadie D <to...@gmail.com>.
I think you could do that via mod_rewrite

RewriteRule ^/project/(.*)/dynamic/(.*)
http://tomcat/project/$1/dynamic/$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://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Selectively forward trafic from Apache to Tomcat

Posted by Gregor Schneider <rc...@googlemail.com>.
http://tomcat.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://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org