Troubleshooting mod_jk connector issues with backend application server

I’m having trouble getting mod_jk to work properly after migrating to a new server setup. Previously everything was functioning correctly, but now I’m getting connection failures.

My current setup:

  • mod_jk version 1.2.28
  • JBoss 4.2.3 as the backend server
  • AJP 1.3 connector configured on port 8009
  • JBoss bound to the new server IP address

Application deployment:
My application gets deployed with this context path:

[TomcatDeployer] deploy, ctxPath=/AlertSystem, warUrl=.../tmp/deploy/tmp1234567890123456789AlertApp.ear-contents/AlertSystem-exp.war/

Configuration details:

  • Worker properties file has a worker defined for the JBoss IP and port 8009
  • mod-jk.conf contains: JkMount /AlertSystem/* backend_worker

The problem:
When I try to access the application, I get these errors in mod-jk.log:

[Mon Nov 02 15:32:15 2009][31254:3087125336] [error] ajp_send_request::jk_ajp_common.c (1507): (backend_worker) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=115)
[Mon Nov 02 15:32:15 2009][31254:3087125336] [info] ajp_service::jk_ajp_common.c (2447): (backend_worker) sending request to tomcat failed (recoverable), because of error during request sending (attempt=2)
[Mon Nov 02 15:32:15 2009][31254:3087125336] [error] ajp_service::jk_ajp_common.c (2466): (backend_worker) connecting to tomcat failed.

I’ve verified that JBoss is listening on port 8009 using netstat -an and the IP addresses match in both the configuration and logs. What could be causing this connection failure?

errno=115 indicates EINPROGRESS, meaning there’s a network timeout rather than a connection refusal. I experienced similar issues during a migration; it was caused by firewall rules obstructing AJP connections between Apache and JBoss, despite the port being open locally. Please check if your new server has iptables or any firewall settings blocking access to port 8009 for Apache. Also, ensure that JBoss is configured to bind to the correct interface; it might be set to listen only on localhost. You can use netstat -tulpn | grep 8009 to confirm which interface JBoss is using. Additionally, SELinux policies might be restricting Apache’s connection to backend services.

Hmm, are you sure JBoss is actually binding to the external IP? after migrations, servers often default back to 127.0.0.1. what does lsof -i :8009 show? also, did you copy any old worker.properties files that might have stale configs?

same issue last month! timeout values in workers.properties fixed it for me. add socket_timeout=10 and connection_pool_timeout=600 to your worker config. also check your jboss server.xml - make sure the AJP connector isn’t commented out. migrations sometimes miss that.