Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting Max HTTP Header Size With AJP / Tomcat 6.0

If you're not using AJP, Tomcat 6.0 Connectors have a nice maxHttpHeaderSize attribute in server.xml. But if you are using AJP, that attribute is not understood. Is there any way to increase the allowed HTTP header size if you are writing an app that is using AJP?

(maxHttpHeaderSize is documented at http://tomcat.apache.org/tomcat-6.0-doc/config/http.html but there is also this in that document: "If you wish to configure the Connector that is used for connections to web servers using the AJP protocol (such as the mod_jk 1.2.x connector for Apache 1.3), see here instead." The "here" link points to http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html where maxHttpHeaderSize is omitted from the list of attributes.)

like image 710
Trott Avatar asked Jul 26 '11 22:07

Trott


1 Answers

The AJP protocol is packet oriented, and in the Basic Packet Structure section of mod_proxy_ajp it says:

According to much of the code, the max packet size is 8 * 1024 bytes (8K). The actual length of the packet is encoded in the header.

Send Headers has a packet code of 4, so it appears all the headers need to fit in a single packet with a 8k limit. However, if How to set the AJP packet size in Tomcat? is correct, you can increase that limit.

like image 192
Kevin Hakanson Avatar answered Oct 11 '22 23:10

Kevin Hakanson