You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jakub 1983 <jj...@gmail.com> on 2013/04/09 17:03:32 UTC

connectors - what are JK, AJP, APR

)
http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html 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<http://tomcat.apache.org/tomcat-7.0-doc/config/engine.html>
.

The *native connectors* supported with this Tomcat release are:

   - JK 1.2.x with any of the supported servers. See the JK
docs<http://tomcat.apache.org/connectors-doc/>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<http://httpd.apache.org/docs/2.2/mod/mod_proxy_ajp.html>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)
http://tomcat.apache.org/tomcat-7.0-doc/apr.html#APR_Connectors_Configurationstates:

*AJP*

For AJP configuration, see the
AJP<http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html>connector
configuration documentation.

it redirects to
http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.htmlwhich states
nothing about apr,
so what is apr ?

11 how can it be put simple in several words ?


regards
Jakub

Re: connectors - what are JK, AJP, APR

Posted by Jakub 1983 <jj...@gmail.com>.
Christopher, thank you for your reply,

yes, maybe on http://tomcat.apache.org/tomcat-7.0-doc/connectors.html could
be a few more simple words about this concepts,
I was mislead by

*The native connectors supported with this Tomcat release are: *

   - *JK 1.2.x with any of the supported servers*
   - *mod_proxy on Apache HTTP Server 2.x (included by default in Apache
   HTTP Server 2.2), with AJP enabled*

was placed under AJP, noot in separate section, It also seemed to me, that
these are some other types of connectors, different from ajp and http, I
alos somehow haven't caught word 'native' as adjective
but now, after your and Andre explanation it is quite clear

*and a few other
things (like SSL details if Apache httpd is doing SSL-termination)
back to the Java server.*

1) could you please expand this topic ?
2) what is SSL-termination ?

3) in case of ajp, httpd uncipher https, and sends normal http to Tomcat ?
4) and how is it in case of mod_proxy_http ? does httpd see what is it
forwarding, or only Tomcat see the content ?
5) how is https treated by these protocols ?

6) it seems to me, that in case of ajp communication between Tomcat and
httpd cannot be ciphered, and in case of http it can be ciphered, right ?
7) but if it is true, with mod_proxy_http what cipher is it, internal
cipher between Tomcat and httpd, and than httpd cipher with external
certificate visible to client,
8) or tomcat do the target ciphering, and httpd gets ciphered packets and
only forwards them to client browser ?

regards
Jakub


On Wed, Apr 10, 2013 at 6:27 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Jakub,
>
> 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:
>
> protocol="org.apache.coyote.ajp.AjpAprProtocol"
>
> This will select the APR-based (native) connector that speaks AJP.
>
> protocol="org.apache.coyote.ajp.Http11AprProtocol"
>
> This will select the APR-based (native) connector that speaks HTTP.
>
> > 10)
> >
> http://tomcat.apache.org/tomcat-7.0-doc/apr.html#APR_Connectors_Configurationstates
> :
> >
> >  *AJP*
> >
> > For AJP configuration, see the
> > AJP<http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html>connector
> >
> >
> configuration documentation.
> >
> > it redirects to
> > http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.htmlwhich
> > states nothing about apr, so what is apr ?
>
> Sure it does:
>
> http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html#APR/native_specific_configuration
>
> > 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?
>
> http://tomcat.apache.org/tomcat-7.0-doc/connectors.html ?
>
> 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
> communication).
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJRZZL3AAoJEBzwKT+lPKRYFFIP/1oXukHpcyzSehazEBv+6Wlh
> HWm8QWlZhO+Si+aMNIZ5f/WsMNzD0r+X4GF43tH4yEizw0yKXX40xvXOgXv+fQBR
> HabcjQId+JovZuNHOh8NeQL4j+NRKoKMkn8OS7XPOcCr+XLdp+wo7sfRH/7D+FiM
> PsDQIEle07lv64WZbWAiiJUzCJDG2Sg35kotjpks/1bXfArwANALgmOvPuLwW72B
> 21wIMPClCnWrlaHqLmrRlJdT97BeeKHFIvq1uDTTnHlPm2M+7W7yIWoMVW1L7J1R
> Vi5B9UJBxPh2liNz08lA9cf4jI9ikhBog+CZLoJ49cc/htHZsykOP3yivzmr/1BS
> Udwlec6FEjt6u9fuHXcDs6M61M40dtSvbjlCinkwtA0Pp4t6oUTZerqam9Ekl7Ve
> pSu/CnBL/NszGpyribg+FfamYan71N54ULG1mQN+IMoAjiYTUkZZJP+khLYzaZd3
> PoqqUhG7pEm5IZ5E4HQCqU7e1iR/qvnlH43YDA8wBal7op04/sTXnNaVyERrZIkb
> Yww+iQVwthApnvX8VGhXchS1rJkX0B69/UdN/kUHtaSLXiEjaxIsBQAFe7hhI4gZ
> 9rmaqmJSMvXns3WI5w64PvGgw+Xz6AZleCH0sFEWu/nHgWyEi8bocJ2UqoX/+7sy
> KhNTWWR3ugQV6diuvo3K
> =rpG5
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: connectors - what are JK, AJP, APR

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Jakub,

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:

protocol="org.apache.coyote.ajp.AjpAprProtocol"

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

protocol="org.apache.coyote.ajp.Http11AprProtocol"

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

> 10) 
> http://tomcat.apache.org/tomcat-7.0-doc/apr.html#APR_Connectors_Configurationstates:
>
>  *AJP*
> 
> For AJP configuration, see the 
> AJP<http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html>connector
>
> 
configuration documentation.
> 
> it redirects to 
> http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.htmlwhich
> states nothing about apr, so what is apr ?

Sure it does:
http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html#APR/native_specific_configuration

> 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?

http://tomcat.apache.org/tomcat-7.0-doc/connectors.html ?

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
communication).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRZZL3AAoJEBzwKT+lPKRYFFIP/1oXukHpcyzSehazEBv+6Wlh
HWm8QWlZhO+Si+aMNIZ5f/WsMNzD0r+X4GF43tH4yEizw0yKXX40xvXOgXv+fQBR
HabcjQId+JovZuNHOh8NeQL4j+NRKoKMkn8OS7XPOcCr+XLdp+wo7sfRH/7D+FiM
PsDQIEle07lv64WZbWAiiJUzCJDG2Sg35kotjpks/1bXfArwANALgmOvPuLwW72B
21wIMPClCnWrlaHqLmrRlJdT97BeeKHFIvq1uDTTnHlPm2M+7W7yIWoMVW1L7J1R
Vi5B9UJBxPh2liNz08lA9cf4jI9ikhBog+CZLoJ49cc/htHZsykOP3yivzmr/1BS
Udwlec6FEjt6u9fuHXcDs6M61M40dtSvbjlCinkwtA0Pp4t6oUTZerqam9Ekl7Ve
pSu/CnBL/NszGpyribg+FfamYan71N54ULG1mQN+IMoAjiYTUkZZJP+khLYzaZd3
PoqqUhG7pEm5IZ5E4HQCqU7e1iR/qvnlH43YDA8wBal7op04/sTXnNaVyERrZIkb
Yww+iQVwthApnvX8VGhXchS1rJkX0B69/UdN/kUHtaSLXiEjaxIsBQAFe7hhI4gZ
9rmaqmJSMvXns3WI5w64PvGgw+Xz6AZleCH0sFEWu/nHgWyEi8bocJ2UqoX/+7sy
KhNTWWR3ugQV6diuvo3K
=rpG5
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: connectors - what are JK, AJP, APR

Posted by Jakub 1983 <jj...@gmail.com>.
yes, it was very helpful,

great thanks.


On Tue, Apr 9, 2013 at 6:20 PM, André Warnier <aw...@ice-sa.com> wrote:

> Oh my..
>
> Jakub 1983 wrote:
>
>> )
>> http://tomcat.apache.org/**tomcat-7.0-doc/config/ajp.html<http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html>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<http://tomcat.apache.**org/tomcat-7.0-doc/config/**engine.html<http://tomcat.apache.org/tomcat-7.0-doc/config/engine.html>
>> >
>> .
>>
>> The *native connectors* supported with this Tomcat release are:
>>
>>    - JK 1.2.x with any of the supported servers. See the JK
>> docs<http://tomcat.apache.org/**connectors-doc/<http://tomcat.apache.org/connectors-doc/>>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<http://httpd.apache.org/**docs/2.2/mod/mod_proxy_ajp.**html<http://httpd.apache.org/docs/2.2/mod/mod_proxy_ajp.html>
>> >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)
>> http://tomcat.apache.org/**tomcat-7.0-doc/apr.html#APR_**
>> Connectors_Configurationstates<http://tomcat.apache.org/tomcat-7.0-doc/apr.html#APR_Connectors_Configurationstates>
>> **:
>>
>> *AJP*
>>
>>
>> For AJP configuration, see the
>> AJP<http://tomcat.apache.org/**tomcat-7.0-doc/config/ajp.html<http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html>
>> **>connector
>>
>> configuration documentation.
>>
>> it redirects to
>> http://tomcat.apache.org/**tomcat-7.0-doc/config/ajp.**htmlwhich<http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.htmlwhich>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 : http://en.wikipedia.org/wiki/**Apache_Portable_Runtime<http://en.wikipedia.org/wiki/Apache_Portable_Runtime>
> For AJP : http://en.wikipedia.org/wiki/**Apache_JServ_Protocol<http://en.wikipedia.org/wiki/Apache_JServ_Protocol>
>
> When you connect to a server program (like Apache httpd or Apache Tomcat),
> you connect to a TCP listening port (http://en.wikipedia.org/wiki/**
> TCP_port <http://en.wikipedia.org/wiki/TCP_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 :
> http://en.wikipedia.org/wiki/**Java_virtual_machine<http://en.wikipedia.org/wiki/Java_virtual_machine>).
>  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 http://en.wikipedia.org/wiki/**Operating_system<http://en.wikipedia.org/wiki/Operating_system>
> ).
> These are called "native", because they use "native code" (code that works
> only under one OS).
>
> 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: users-unsubscribe@tomcat.**apache.org<us...@tomcat.apache.org>
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: connectors - what are JK, AJP, APR

Posted by André Warnier <aw...@ice-sa.com>.
Oh my..

Jakub 1983 wrote:
> )
> http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html 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<http://tomcat.apache.org/tomcat-7.0-doc/config/engine.html>
> .
> 
> The *native connectors* supported with this Tomcat release are:
> 
>    - JK 1.2.x with any of the supported servers. See the JK
> docs<http://tomcat.apache.org/connectors-doc/>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<http://httpd.apache.org/docs/2.2/mod/mod_proxy_ajp.html>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)
> http://tomcat.apache.org/tomcat-7.0-doc/apr.html#APR_Connectors_Configurationstates:
> 
> *AJP*
> 
> For AJP configuration, see the
> AJP<http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.html>connector
> configuration documentation.
> 
> it redirects to
> http://tomcat.apache.org/tomcat-7.0-doc/config/ajp.htmlwhich 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 : http://en.wikipedia.org/wiki/Apache_Portable_Runtime
For AJP : http://en.wikipedia.org/wiki/Apache_JServ_Protocol

When you connect to a server program (like Apache httpd or Apache Tomcat), you connect to 
a TCP listening port (http://en.wikipedia.org/wiki/TCP_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 : 
http://en.wikipedia.org/wiki/Java_virtual_machine).  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 http://en.wikipedia.org/wiki/Operating_system).
These are called "native", because they use "native code" (code that works only under one OS).

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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org