Apache-Tomcat-Connectors and building mod_jk

Brian Millett bmillett at gmail.com
Fri Nov 10 00:10:22 UTC 2006


Timothy Alberts wrote:
>> The easiest answer is that with apache 2.2.3 you do not need it
> anymore.
>> What you want to use is the mod_proxy_ajp module.  I've set up a
>> clustered tomcat on a machine and I load balance between the three
>> tomcats with just the following configuration.  NOTE that the
>> communication is with "ajp://"
> 
> Brian, thank you for the information.  Now please excuse me for a moment
> while I curse ASF.
> 
> *&!@#*%&!@#*&$*&#*!@&*$!&@#*$&!@#&!*$#&%*!@#$&!@*#&%!@#$*&!*@#&*!@#*#@
> $&!*%&$!*@#&$*!@#!@#%*!@#$&!*@#&$!*@#&$*!@&%*!@&#%**$#&@*&@!#*$&*@#&*&!
> @#%!&@#$*!@&#*!@%&*&@!#$$!*&@!#*$&!@#*&%*&!#$@*&!@&@#$**%&!@
> 
> OK, I feel better now.
> 
> So I spent the last few days learning/compiling/configuring mod_jk only
> to find out that ASF has invented a new way of doing it.  As I research
> this I see many people expressing the same general discontent for this.
> 
> Is there a noobies guide for migrating from mod_jk to mod_proxy_ajp
> running around that anyone recommends?

(I replyed to Timothy, then realized I needed to reply to the list)

Basicly, any webapp that you have deployed can be proxyed to with out
any mod_jk vodoo.  It just happens.  I've a helpdesk.war that I've
deployed.  To access it I have the following:

  LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

  ProxyRequests Off

  # Make sure that the virtual host name is passed through to the
  # backend servlet container for virtual host support.
  ProxyPreserveHost On

  # Tell mod_mod proxy that it should not send back the body-content of
  # error pages, but be fascist and use its local error pages if the
  # remote HTTP stack is sending an HTTP 4xx or 5xx status code.
  ProxyErrorOverride On
  ProxyPassReverse / ajp://localhost:8009/

  <Location "/helpdesk">
     <LimitExcept POST GET PUT>
        Order Deny,Allow
        Deny from all
        Allow from none
     </LimitExcept>
     DirectoryIndex logon.jsp
     RewriteEngine On
     RewriteRule \.(pl|php|cgi) - [PT,L]
     RewriteRule \.(jpg|jpeg|gif|png|html)$ - [PT,L]
     RewriteRule ".*/WEB-INF/?.*" - [L,F,NC]
     RewriteRule \.(jsp|jspx|do) "ajp://localhost:8009%{REQUEST_URI}" [P,L]
     RewriteRule ".*/servlet/.*" "ajp://localhost:8009%{REQUEST_URI}" [P,L]
  </Location>


I use the [P,L] options to mod_rewrite to proxy to ajp://.  It really is
simple.  I beat my head against a wall once I realized how simple it was.

-- 
Brian Millett - [ Ivanova, "Deathwalker"]
"Justice or immortality. An intriguing choice."




More information about the fedora-list mailing list