tomcat8mod-jkajp

invalid message signature AJP 514


We are facing issue with the large request-header. Recently we came to know that some of the large cookies got sent to the server which goes beyond the default limit of 8192. We tried to bump max_packet_size in workers.properies(mod_jk) as well as tomcat's AJP connector(packet size) to 65536. Now request is getting throuh to the tomcat but in tomcat's Catalina.out we are getting SERVER log message:

28-Feb-2018 22:23:34.137 SEVERE [ajp-nio-7009-exec-5] org.apache.coyote.ajp.AjpMessage.processHeader Invalid message received with signature 514

Our server setup flow is something like: ELB ->(https) -> httpd -> mod_jk+AJP13 ->(http) -> tomcat. Tomcat version: 8.0.20 httpd version: 2.4.27 mod_jk version: 1.2.37 Please help us to find the root cause.


Solution

  • We have to go with the following configuration:

    server.xml
        packetSize="32768"
        socket.appReadBufSize="32768"
    
    httpd.conf
        LimitRequestFieldsize 32768
    
    workers.properties
        worker.app-7009.max_packet_size=32768
    

    socket.appReadBufSize is important attribute, without this tomcat's AJP connector unable to read the packet posted.