mod_proxy vs mod_proxy_ajp vs mod_jk

Solution 1:

2 mod_proxy_http, unless you need the Host header from the client.

I don't recommend classic mod_jk because its functionality has been replaced by mod_proxy_ajp and as you said yourself, it requires building and maintaining that module yourself.

I think mod_proxy_http is a very clean solution and it takes ajp out of the picture. However, you should be aware of a few caveats for moving from ajp to http. If you need access to the server headers exactly as they were received by apache (including the Host header), the you should use ajp. JBoss will see a fresh http request coming from apache, not the original client. If you only need the remote IP of the client, you can still get this with a special header that apache can set on the new requests. However, if you are doing virtual hosting from the application layer, you're better off with ajp.

As far as performance is concerned, either ajp or http will require some processing by JBoss and some local socket TCP traffic. You'll have to try both to see which is more efficient, but I think overall it's a very small percentage of the total server load. Http is a more complicated protocol and ajp is specifically designed to efficiently between web and app tiers, so theoretically ajp is probably better. That said, I have found that http is often better supported outside of the Tomcat app server line.

I use mod_proxy_ajp and mod_proxy_http and I have had no problems whatsoever.