tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: connectors - what are JK, AJP, APR
Date Wed, 10 Apr 2013 16:27:35 GMT
Hash: SHA256


While André has already answered, I think it's worth re-iterating what
everything is, here. See below.

On 4/9/13 11:03 AM, Jakub 1983 wrote:
> 2) what does "native connectors" mean here ?

A "native connector" is the native (i.e. non-Java) component that
actually runs in the web server. This piece of the puzzle is
completely outside of Tomcat.

> 3) what is JK ? and what is mod_proxy ? are both of them some
> alternative implementations of ajp ? who uses them, tomcat or
> apache http*d* web server ?

Yes, "JK" (formally "mod_jk") and mod_proxy are alternatives, both of
which are modules that you be loaded into Apache httpd. (mod_jk also
includes components that can be used in Microsoft IIS and a few other
web servers, too, while mod_proxy is IIRC strictly for Apache httpd).

(Note that mod_jk always speaks the AJP protocol while mod_proxy can
use either HTTP or AJP... we'll get to that, later.)

> 5) how should I define JK connector ?

The connector that you configure needs to speak the protocol of the
native component. If you have used mod_jk or mod_proxy in it's "AJP"
flavor, then you'll want to configure a connector with the "AJP"
protocol, like this:

<Connector protocol="AJP/1.3" ... />

(You'll also have to provide the port number and any other
configuration you want. Merely specifying protocol="AJP/1.3" selects
the connector that can speak AJP".)

If you want to choose a specific implementation of connector (see
below), you can provide any of these explicit implementations:

org.apache.coyote.ajp.AjpProtocol - blocking Java connector
org.apache.coyote.ajp.AjpNioProtocol - non blocking Java connector
org.apache.coyote.ajp.AjpAprProtocol - the APR/native connector

> 6) what JK has to do with AJP ?

mod_jk speaks "AJP" which stands for "Apache JServ Protocol". It's a
throwback from when Tomcat was called "Apache JServ" and the protocol
was invented to allow Apache httpd to talk to Apache JServ. It
basically forwards HTTP headers, request-bodies, and a few other
things (like SSL details if Apache httpd is doing SSL-termination)
back to the Java server.

> 7) which terms concern tomcat and which apache httpd server ?

AJP is a protocol used by both sides. Everything else is separate.

> 8) where is *APR* in above context ?

The waters get a little muddy, here, because APR stands for Apache
Portable Runtime. It's a library that the ASF uses for a few projects,
including Apache httpd. Tomcat has an optional native module that can
use the same library to do some high-performance stuff that Java can't
do, such as native sockets and OpenSSL integration (using OpenSSL for
crypto is measurably faster than using Java's JSSE to do the same task).

Tomcat provides an optional set of "native" connector called the "APR"
connector because it's based upon the APR library. There are
connectors for HTTP(S) and AJP. So, you can mix-and-match HTTP/AJP
protocols with BIO/NIO/APR connectors.

> 9) how do I define APR connector (is it possible)?

You can set the "protocol" attribute to the class you want to use as
your connector, like this:


This will select the APR-based (native) connector that speaks AJP.


This will select the APR-based (native) connector that speaks HTTP.

> 10) 
>  *AJP*
> For AJP configuration, see the 
> AJP<>connector
configuration documentation.
> it redirects to 
> states nothing about apr, so what is apr ?

Sure it does:

> 11 how can it be put simple in several words ?

Unfortunately, it's not a simple subject. Perhaps more care could be
given when explaining these things in the documentation. Which page do
you think would benefit from a better introduction to all these concepts? ?

Unfortunately, things get even more confusing when you introduce the
concept of asynchronous dispatch, because the different connectors
behave somewhat differently under those circumstances (e.g. the BIO
connector does not actually allow non-blocking, asynchronous

- -chris
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Thunderbird -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message