tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: connectors - what are JK, AJP, APR
Date Tue, 09 Apr 2013 16:20:55 GMT
Oh my..

Jakub 1983 wrote:
> )
> states:
> The *AJP Connector* element represents a *Connector* component that
> communicates with a web connector via the AJP protocol. This is used for
> cases where you wish to invisibly integrate Tomcat into an existing (or
> new) Apache installation, and you want Apache to handle the static content
> contained in the web application, and/or utilize Apache's SSL processing.
> This connector supports load balancing when used in conjunction with the
> jvmRoute attribute of the
> Engine<>
> .
> The *native connectors* supported with this Tomcat release are:
>    - JK 1.2.x with any of the supported servers. See the JK
> docs<>for details.
>    - mod_proxy on Apache httpd 2.x (included by default in Apache HTTP
>    Server 2.2), with AJP enabled: see the httpd
> docs<>for
> details.
> *Other native connectors supporting AJP may work, but are no longer
> supported.*
> 1) what does it mean in some other words ??
> 2) what does "native conntectors" mean here ?
> 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
> ?
> 4) pieces of server.xml
>     <!-- A "Connector" represents an endpoint by which requests are received
>          and responses are returned. Documentation at :
>          Java HTTP Connector: /docs/config/http.html (blocking &
> non-blocking)
>          Java AJP  Connector: /docs/config/ajp.html
>          APR (HTTP/AJP) Connector: /docs/apr.html
>          Define a non-SSL HTTP/1.1 Connector on port 8080
>     -->
>     <Connector port="8080" protocol="*HTTP*/1.1"
>                connectionTimeout="20000"
>                redirectPort="443" />
>     <!-- Define an AJP 1.3 Connector on port 8009 -->
>     <Connector port="8009" protocol="*AJP/1.3*" redirectPort="8443" />
> 5) how should I define JK connector ?
> 6) what JK has to do with AJP ?
> 7) which terms concern tomcat and which apache httpd server ?
> 8) where is *APR* in above context ?
> 9) how do I define APR connector (is it possible)?
> 10)
> *AJP*
> For AJP configuration, see the
> AJP<>connector
> configuration documentation.
> it redirects to
> states
> nothing about apr,
> so what is apr ?
> 11 how can it be put simple in several words ?

The simple answer is that it cannot, there would be too many words anyway.

But the good thing is that a lot of it is already described on-line.
Do you know Wikipedia ?
For APR :
For AJP :

When you connect to a server program (like Apache httpd or Apache Tomcat), you connect to

a TCP listening port (
In Tomcat, such a listening port is created and opened by a specific part of the Tomcat 
code, known as a "connector".  Some such "connectors" are written purely in Java code, so

they are totally portable to any machine that runs a Java Virtual Machine (JVM, see here :  Others are written so that they use a

part that is not written in Java, but is specific to the particular OS under which you run

Tomcat (for OS, see
These are called "native", because they use "native code" (code that works only under one

AJP is a communications protocol (like HTTP or Telnet or FTP). It is different from HTTP,

but it can carry the same kind of information as HTTP (HTTP requests, headers, body,..).
It is the protocol used in some cases when you "connect" a front-end httpd server (like 
Apache httpd or Microsoft IIS) with a back-end Tomcat server.
For example, when you connect Apache httpd to Tomcat, you have this kind of setup :

Browser <-HTTP-> Apache httpd + mod_jk <--AJP--> Tomcat AJP Connector + Tomcat

So, on the Apache httpd side, you have the mod_jk module, which knows the AJP protocol, 
and which translates the browser request into "AJP language" to pass it to Tomcat.  And on

the Tomcat side, you have an AJP Connector, which also understands the "AJP language" and

translates the request from AJP to something that Tomcat understands.

You can also connect Apache httpd to Tomcat in a different way, using this setup :

Browser <-HTTP-> Apache httpd + mod_proxy <--HTTP--> Tomcat HTTP Connector + Tomcat
mod_proxy does not understand AJP, it only understands and talks HTTP.  So on the Tomcat 
side, you also need a Connector that understands HTTP, not AJP.

Sometimes one way is better, sometimes the other. It is your choice.

Does this help ?

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

View raw message