Apache - Windows vs Linux
bryan.sant at gmail.com
Wed Jan 25 13:03:06 MST 2006
On 1/25/06, Ryan Bowman <ryanlbowman at gmail.com> wrote:
> We are using mod_jk, the jboss configs include ajp connectors so we
> assumed thats what they reccomend. Why is mod_proxy better? We're
> probably amiable to switching if it would be benificial. Please post
> an example config.
I've found that mod_jk holds on to connections with the app server and
tries to pool and reuse them. This sounds like a great optimization,
but I've seen similar problems to what you're describing. I believe
the AJP protocol is stateful, so rebooting JBoss (the server) without
bouncing apache (the client) may leave the client is a confused state.
You may be able to resolve this just by bounce apache when you bounce
JBoss. Nonetheless, I would say that mod_jk is bad. To my knowledge,
mod_jk (and mod_jk2) have basically been abandoned. No one actively
improves them. It is a good idea with a bad implementation.
Mod_proxy isn't as sophisticated, but it is VERY reliable and can
connect to ANYTHING in the background -- be that a J2EE server or any
other HTTP server. Standard HTTP rules apply including timeouts and
other things that will protect the client and server from holding onto
things longer than needed.
Anywho. He is how you would configure mod_proxy:
# Your httpd.conf may already load mod_proxy, but if not...
LoadModule proxy_module modules/mod_proxy.so
# Don't EVER allow forward proxy requests!
# Don't proxy these URIs through to JBoss.
# We want static content served off apache.
ProxyPass /img !
ProxyPass /css !
ProxyPass /scripts !
ProxyPass /favicon.ico !
# Anything that didn't match above, should be forwarded to JBoss.
ProxyPass / http://10.0.0.1:8080/
ProxyPassReverse / http://10.0.0.1:8080/
More information about the PLUG