. : http://www.arcetri.astro.it/manual/ja/mod/mod_proxy_ajp.html
: Mon Jan 21 19:44:30 2013
: Fri Feb 28 07:50:49 2014
: IBM-866

:
mod_proxy_ajp - Apache HTTP ²î
<-
Apache > HTTP ²î > Áî§Á > î¦Á 2.2 > ¦î

Apache ¦î mod_proxy_ajp

í ۇ֐ˑ
:mod_proxy AJP ²î¦î
µîƒµ:Extension
¦î:proxy_ajp_module
­îµ:mod_proxy_ajp.c

¦î mod_proxy Apache JServ Protocol version 1.3 ( AJP13) ²î

AJP13 ɑ mod_proxy mod_proxy_ajp ²î

²î§íʵ îÁ§²îî Áƒî͑١

¦î

top



AJP13 ‘ îÁµ îÁµԑ ²î²îÁ TCP §Á ­‘ͧ²îÁ TCP ՐµèµÁµ² §Á

µ§Áɒ² §Áµ §Áîֵ §Á

²îÁ§Á§Áʴ :

§Áɵµ²Áߡ ( HTTP ) (ՇՐÁî) µ‘ µ (content-length > 0) ߡۇ‘

µ²îÁ ¨î¦²îȨ

¨î¦Ր µÁµ‘

top

ߡ‘

 XDR µ Ր ( 4 Á)

îî: ÁÁ ÁÁ XDR ه sys/socket (C ) ­‘Ѯǡֵ

 4 : byte, boolean, integer, string

Byte
Boolean
1 = true, 0 = false (C ) ۴ɑ
Integer
0 2^16 (32768) ےՐ 2
String
է (2^16 է) է‘ 2 ( '\0' ) Áî Áîէ '\0' Á strlen µсÁÁ ۦ Java ԑServlet Áǡ ʵ C îۦ²î \0 C îî Áµۦ '\0' C î

‘²¡

î‘²¡²¡ 8 * 1024 (8K) ‘է Áî

‘

²îÁǡ‘ 0x1234 Á²î‘ AB (ASCII î A ASCII î B) îէ () îէ 2^16 î 8K

‘ (Server->Container)
Byte 0 1 2 3 4...(n+3)
Contents 0x12 0x34 îƒէ (n) Data
‘ (Container->Server)
Byte 0 1 2 3 4...(n+3)
Contents A B îƒէ (n) Data

‘î¨î¦Áî ²îÁµ‘ ‘ (0x1234 ‘է) µî

²î¨î¦²îÁǡ

î ‘ с
2 Forward Request µ²îƒ
7 Shutdown ²îÁÁ
8 Ping ²îÁȴ (¨Áî¡)
10 CPing ²îÁ CPong ́
none Data ²¡ (2 ) îƒ

ߡ¨µ§Á §ÁµÁ Shutdown

Data ‘Forward Request ۇ²î

²îÁ²îƒ¨î¦ :

î ‘ с
3 Send Body Chunk ²îÁ²î (´)Á
4 Send Headers ²îÁ²î (´) µÁµ
5 End Response µÁµ (µ²) ͐
6 Get Body Chunk 挟
9 CPong CPing µ

¨î¦Ր

top

µ‘

²îÁ¨î¦ Forward Request :

AJP13_FORWARD_REQUEST :=
    prefix_code      (byte) 0x02 = JK_AJP13_FORWARD_REQUEST
    method           (byte)
    protocol         (string)
    req_uri          (string)
    remote_addr      (string)
    remote_host      (string)
    server_name      (string)
    server_port      (integer)
    is_ssl           (boolean)
    num_headers      (integer)
    request_headers *(req_header_name req_header_value)
    attributes      *(attribut_name attribute_value)
    request_terminator (byte) OxFF
    

request_headers :

req_header_name := 
    sc_req_header_name | (string)  [see below for how this is parsed]

sc_req_header_name := 0xA0xx (integer)

req_header_value := (string)

§Á :

attribute_name := sc_a_name | (sc_a_req_attribute string)

attribute_value := (string)

    

content-length Á‘

Forward Request

Request prefix

µ 2 Prefix î

Method

HTTP ­ 1 Áî :

Command NameCode
OPTIONS1
GET2
HEAD3
POST4
PUT5
DELETE6
TRACE7
PROPFIND8
PROPPATCH9
MKCOL10
COPY11
MOVE12
LOCK13
UNLOCK14
ACL15
REPORT16
VERSION-CONTROL17
CHECKIN18
CHECKOUT19
UNCHECKOUT20
SEARCH21
MKWORKSPACE22
UPDATE23
LABEL24
MERGE25
BASELINE_CONTROL26
MKACTIVITY27

ajp13 î¦Á­

protocol, req_uri, remote_addr, remote_host, server_name, server_port, is_ssl

µ

Headers

request_headers : Ր num_headers Áî req_header_name / req_header_value ʵՇՐÁî ߡ (է µ) sc_req_header_name î (̡) :

îî
accept0xA001SC_REQ_ACCEPT
accept-charset0xA002SC_REQ_ACCEPT_CHARSET
accept-encoding0xA003SC_REQ_ACCEPT_ENCODING
accept-language0xA004SC_REQ_ACCEPT_LANGUAGE
authorization0xA005SC_REQ_AUTHORIZATION
connection0xA006SC_REQ_CONNECTION
content-type0xA007SC_REQ_CONTENT_TYPE
content-length0xA008SC_REQ_CONTENT_LENGTH
cookie0xA009SC_REQ_COOKIE
cookie20xA00ASC_REQ_COOKIE2
host0xA00BSC_REQ_HOST
pragma0xA00CSC_REQ_PRAGMA
referer0xA00DSC_REQ_REFERER
user-agent0xA00ESC_REQ_USER_AGENT

Java î 2 ՇՐ ͐ '0xA0' Áµ 0xA0 2 էՇՐ

է 0x9999 (==0xA000 -1)

:

content-length ®µ ( POST µ) ۇ‘µî

? µ ( ?context) í 1 î (C î ) §Áµɵî î :

InformationCode ValueNote
?context0x01
?servlet_path0x02
?remote_user0x03
?auth_type0x04
?query_string0x05
?jvm_route0x06
?ssl_cert0x07
?ssl_cipher0x08
?ssl_session0x09
?req_attribute0x0AName (the name of the attribute follows)
?ssl_key_size0x0B
are_done0xFFrequest_terminator

context servlet_path Ϭ C î¨ Java î î (î ) ϒî §Á

remote_user auth_type HTTP îî´î´ ƒ ( Basic, Digest)

query_string, ssl_cert, ssl_cipher, ssl_session HTTP HTTPS

jvm_route µî¨§Á²î îÁµՐ²îɵ Tomcat ÁµƒÁµ î´¨§Áí

ߡreq_attribute î 0x0A ԑ îۇ ҐՐֵ

0xFF ǡϧµ ‘

top

µÁµ‘

Á²î¨î¦:

AJP13_SEND_BODY_CHUNK :=
  prefix_code   3
  chunk_length  (integer)
  chunk        *(byte)


AJP13_SEND_HEADERS :=
  prefix_code       4
  http_status_code  (integer)
  http_status_msg   (string)
  num_headers       (integer)
  response_headers *(res_header_name header_value)

res_header_name :=
    sc_res_header_name | (string)   [see below for how this is parsed]

sc_res_header_name := 0xA0 (byte)

header_value := (string)

AJP13_END_RESPONSE :=
  prefix_code       5
  reuse             (boolean)


AJP13_GET_BODY_CHUNK :=
  prefix_code       6
  requested_length  (integer)
    

:

Send Body Chunk

Áߡۇ

Send Headers

µîƒµî¨î¦ HTTP ( 200 OK)µÁµ µֵÁî îֵ header_encoding î :

î
Content-Type0xA001
Content-Language0xA002
Content-Length0xA003
Date0xA004
Last-Modified0xA005
Location0xA006
Set-Cookie0xA007
Set-Cookie20xA008
Servlet-Engine0xA009
Status0xA00A
WWW-Authenticate0xA00B

îۇÁî

End Response

µ²reuse  (==1) Ϭ TCP §Á֐ µreuse (C î 1 ) §Á

Get Body Chunk

(²¡‘ µÁ) Áµ î request_length (8186 (8 Kbytes - 6)) ےµîƒ
îƒ (²î ) ²î îէ 0 ‘(0x12,0x34,0x00,0x00)

:  en  |  ja 

top

Á

Notice:
This is not a Q&A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our mailing lists.