<Connector protocol="org.apache.coyote.http11.Http11AprProtocol"  ..>

현재 톰캣은 아래의 6가지의 Connector protocol이 있다. 

org.apache.coyote.http11.Http11Protocol
org.apache.coyote.http11.Http11NioProtocol
org.apache.coyote.http11.Http11AprProtocol
org.apache.coyote.ajp.AjpProtocol
org.apache.coyote.ajp.AjpAprProtocol
org.apache.jk.server.JkCoyoteHandler (protocol보다는 jk handler인데, 광의차원에서 protocol로 넣어준다)


톰캐 5.5부터 자세한 내용을 본다..

톰캣 5.5 

connector 가 http일 때,
http://tomcat.apache.org/tomcat-5.5-doc/config/http.html
protocol : This attribute value must be HTTP/1.1 to use the HTTP handler, which is the default.


connector가 ajp일 때,
http://tomcat.apache.org/tomcat-5.5-doc/config/ajp.html
protocol : This attribute value must be AJP/1.3 to use the AJP handler.

톰캣 5.5에서는 
ajp/1.3은 org.apache.jk.server.JkCoyoteHandler를 의미하고, http 1.1 protocol에서는 org.apache.coyote.http11.Http11Protocol를 사용하였다.


Tomcat 6

connector 가 http일 때,
protocol
Sets the protocol to handle incoming traffic. The default value is HTTP/1.1 and configures the org.apache.coyote.http11.Http11Protocol. This is the blocking Java connector.
If the PATH(Windows) or LD_LIBRARY_PATH(on most unix system) environment variables contain the Tomcat native library, the APR connector will automatically be configured. Please be advised that the APR connector has different settings for HTTPS than the default Java connector.
Other values for this attribute are, but not limited to:
org.apache.coyote.http11.Http11Protocol - same as HTTP/1.1
org.apache.coyote.http11.Http11NioProtocol - non blocking Java connector
org.apache.coyote.http11.Http11AprProtocol - the APR connector.
Take a look at our Connector Comparison chart. The configuration for both Java connectors are identical, both for http and https. 
For more information on the APR connector and APR specific SSL settings please visit the APR documentation


connector가 ajp일 때,
protocol
Sets the protocol to handle incoming traffic. The default value is AJP/1.3 and configures org.apache.jk.server.JkCoyoteHandler the original blocking Java connector by default.
If the PATH (Windows) or LD_LIBRARY_PATH (on most unix systems) environment variables contain the Tomcat native library, the native/APR connector will automatically be configured instead.
To use an explicit protocol rather than rely on the auto-switching mechanism described above, the following values may be used:
org.apache.jk.server.JkCoyoteHandler - original blocking Java connector
org.apache.coyote.ajp.AjpProtocol - new blocking Java connector that supports an executor
org.apache.coyote.ajp.AjpAprProtocol - the APR/native connector.
Custom implementations may also be used.


내가 보통 쓰는 방법은 세가지였다..

1) 아파치와 연동하는 것
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009" 
               enableLookups="false" redirectPort="8443" protocol="AJP/1.3" URIEncoding="UTF-8"/>


2) 직접 요청을 받아서 처리하는 것
    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector port="8080" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="UTF-8"/>


3) comet을 이용하는 것
<connector connectiontimeout="20000" port="8000">
     protocol="org.apache.coyote.http11.Http11NioProtocol" useComet="true" redirectPort="8443"/>

공부를 하기 위한 좋은 내용이 있어서 소개한다.
http://tomcat.apache.org/tomcat-6.0-doc/config/http.html#Connector Comparison

Connector Comparison

Below is a small chart that shows how the connectors differentiate.

                  Java Blocking Connector       Java Nio Blocking Connector       APR Connector
    Classname         Http11Protocol                  Http11NioProtocol         Http11AprProtocol
    Tomcat Version   3.x 4.x 5.x 6.x                       6.x                     5.5.x 6.x
    Support Polling         NO                             YES                        YES
    Polling Size           N/A                   Unlimited - Restricted by mem        Unlimited - Configurable
    Read HTTP Request     Blocking                     Non Blocking                   Blocking
    Read HTTP Body        Blocking                     Sim Blocking                   Blocking
    Write HTTP Response   Blocking                     Sim Blocking                   Blocking
    SSL Support           Java SSL                     Java SSL                       OpenSSL
    SSL Handshake         Blocking                     Non blocking                   Blocking
    Max Connections       maxThreads                   See polling size               See polling size       



Http 11NioProtocol 공부를 많이 해야겠다는 생각이 든다..
comet 공부 시작해보자~
Posted by '김용환'
,