Nope. That is my prefered way to go. Let apache do what it does best. Let tomcat do what it does best. You'll notice that it'll also take longer before you need to add more tomcats in your cluster by doing this.

What you need to be wary of are any security issues where some static assets need to be protected. Under this scheme - you'll need to duplicate your security in apache - or make sure those static assets are served by tomcat.

-Tim

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 ^/$ http://128.121.26.205/index.jsp [P,NC]
RewriteRule ^/(.*.jsp.*)$ http://128.121.26.205/$1 [P,NC]
RewriteRule ^/(.*.do.*)$ http://128.121.26.205/$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!


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to