tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Bathje <>
Subject Re: Tomcat, Apache connected in interesting way
Date Tue, 23 Nov 2004 18:02:10 GMT
Joshua Szmajda wrote:
> Hi all,
> I run a pretty high traffic site using Tomcat. We've gone through a 
> number of configurations in the past, and I wanted to share with you the 
> newest setup that we're using. It's a bit unorthodox perhaps, and I was 
> wondering if anyone could think of possible problems? It does seem to be 
> the fastest and most stable setup we've had yet.
> Previously we've used Apache and Tomcat connected through jk1 and jk2. 
> Also we've run direct to tomcat's http connector. JK1 was ok, but very 
> slow. JK2 was fast (using unixSocket communication), but very buggy and 
> crash prone. Tomcat alone was good, but it lacked some advanced apache 
> stuff we wanted (Mostly URL Rewriting and good SSL handling).
> After reading about the upcoming mod_proxy ajp connector for apache 2.2, 
> I had the idea to use stuff that's in the current RHEL apache 2.0 
> release to accomplish what I feel to be a similar effect. We've set up 
> apache to reverse proxy requests for .jsp and .do (we're using struts) 
> to tomcat's standard http connector.
>  From the httpd.conf:
> <Proxy *>
>  Order deny,allow
>  Allow from all
> </Proxy>
> ProxyRequests off
> RewriteEngine on
> RewriteRule ^/$ [P,NC]
> RewriteRule ^/(.*.jsp.*)$$1 [P,NC]
> RewriteRule ^/(.*.do.*)$$1 [P,NC]
> This allows apache to process additional rewriting things (I left them 
> out) and also to serve images and other static content. I felt that 
> apache would be better at handling static content than tomcat in 
> general, so this will be an overall speed improvement.
> Anyway, any flaws here I should be aware of? Comments? Thanks!

Joshua -

Are tomcat and apache running on the same server? If so, it appears from 
what you have here that they are on the same am I missing?

Also, how do you handle .jsps and .dos that need to be handled by Tomcat 
securely (using SSL). This seems to pass them all off to the non-secure 
version. Would it just be a more complex RewriteRule that tests for 
https vs. http?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message