Apache with AJP 1.3 and Tomcat 10 are not working well together

264 Views Asked by At

For about 15 years I've been using the Apache Web Server in front of Tomcat and communicating between the two using ajp. Now that I am trying to upgrade to tomcat 10 (from tomcat 5 in one case, tomcat 7 in another), the combination is not working as before. /var/log/httpd/mod_jk_log keeps telling me that "Tomcat is probably not started or is listening on the wrong port"

[Mon Jul 24 13:36:25.246 2023] [523293:140686862894848] [info] jk_open_socket::jk_connect.c (815): connect to ::1:8009 failed (errno=111)
[Mon Jul 24 13:36:25.246 2023] [523293:140686862894848] [info] ajp_connect_to_endpoint::jk_ajp_common.c (1064): (wkr01) Failed opening socket to (::1:8009) (errno=111)
[Mon Jul 24 13:36:25.246 2023] [523293:140686862894848] [error] ajp_send_request::jk_ajp_common.c (1724): (wkr01) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
[Mon Jul 24 13:36:25.246 2023] [523293:140686862894848] [info] ajp_service::jk_ajp_common.c (2774): (wkr01) sending request to tomcat failed (recoverable), because of error during request sending (attempt=1)

That does not seem to be the case

catalina.out tells me the connector is there:

24-Jul-2023 12:47:03.423 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-127.0.0.1-8009"]

ditto for ss:

$ ss -nat
LISTEN 0      100        [::ffff:127.0.0.1]:8009                 *:*           

I can connect to port 8009 on loopback using netcat but I do not know what to send to be certain it is an ajp listener. That will be my next search.

selinux is set to permissive (I'll worry about turning it on later) so that is unlikely to be the cause.

I define the connector thusly:

  <Connector port="8009" enableLookups="false" redirectPort="8080" 
        protocol="AJP/1.3" secretRequired="true"
        secret="2a28.W6AtwbmYvgMgr880oo+EGuWxohr" />

And the worker

workers.tomcat_home=/var/jakarta/tomcat
workers.java_home=/usr/java/default
worker.list=wkr01, jkstatus
worker.jkstatus.type=status
worker.wkr01.type=ajp13
worker.wkr01.host=localhost
worker.wkr01.port=8009
worker.wkr01.lbfactor=50
worker.wkr01.connection_pool_timeout=600
worker.wkr01.socket_keepalive=True
worker.wkr01.socket_timeout=300
worker.wkr01.secret="2a28.W6AtwbmYvgMgr880oo+EGuWxohr"
OS: Oracle Linux 8
Apache Web Server: 2.4.37
Tomcat: 10.1.10

I've just about exhausted my knowledge of Tomcat. Any suggestions?

0

There are 0 best solutions below