I tried googling and the only articles I found comparing these two were from 2005 down to 2002. I just set up my first Tomcat instance to run Jira for a project I'm doing. I want to proxy this through port 80 and apache. From what I can tell, I can easily forward the traffic using mod_proxy. What's the difference iwth using mod_jk? Are there any performance/security differences between these two mods? Anyone have any tips/experience setting up forwarding through apache? I'm running debian Lenny.
Both methods forward requests from apache to tomcat. mod_proxy uses the HTTP that we all know an love. mod_jk uses a binary protocol AJP. The main advantages of mod_jk are:
A slight disadvantage is that AJP is based on fixed sized chunks, and can break with long headers, particularly request URLs with long list of parameters, but you should rarely be in a position of having 8K of URL parameters. (It would suggest you were doing it wrong. :) )
The position is slightly complicated by the existence of mod_proxy_ajp. Between them, mod_jk is the more mature of the two, but mod_proxy_ajp works in the same framework as the other mod_proxy modules. I have not yet used mod_proxy_ajp, but would consider doing so in the future, as mod_jk involves configuration outside of Apache.
Given a choice, I would prefer a AJP based connector, mostly due to my second stated advantage, more than the performance aspect. Of course, if Atlassian doesn't support anything other than mod_proxy_http, that does tie your hands somewhat, but mod_jk does work with JIRA.
Yes there is some difference. However, which you choose to use would depend on your application.
As an example, mod_proxy will function as a normal reverse proxy which will forward only regular headers across while mod_jk would function as a special connector that forwards not only regular headers but also certain other environment variables. A simile can be drawn to scgi and fastcgi connectors.
For the purpose of working with JSP, you should use mod_jk which it was designed for. Use only mod_proxy when forwarding to regular web-servers only (that may launch other ajp connectors behind them).
Hope this helps.
mod_proxy will truely "proxy" all requests to tomcat using the normal http connectors.
mod_jk opens up "ajp13" connections to the tomcat server which are separate from the normal tomcat http connectors and passes traffic that way.
JIRA don't officially support putting tomcat behind apache unless you use
mod_proxy_http
. The recommended configuration goes something like this/etc/httpd/vhosts.d/jira.company.com.conf
/opt/j2ee/domains/company.com/jira/tomcat/conf/server.xml
This should get your going on
http
, let me know if you want an example forhttps
disclaimer: I am currently an Atlassian employee, although I don't work on the JIRA team