• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1729
  • Last Modified:

mod_jk errno=111 with apache2, tomcat6, on ubuntu 10.04

I am experiencing a periodic mod_jk failure which leads to a 503 site error. I can netstat to Tomcat on port 8009 during these failures, so I suspect that there is an issue with the apache => tomcat threads. I have yet to find a culprit thread in a Tomcat stack trace dump.

OS: Ubuntu 10.04
Web Server: Apache2
App Server: Tomcat6

Error from mod_jk.log:
ajp_connect_to_endpoint::jk_ajp_common(c) (922): Failed opening socket to ( (errno=111)


<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
1 Solution
LinuxGuruLinux Server AdministratorCommented:
Have you checked if some other process is listening on port 8009?

netstat -plan | grep ":8009"

Open in new window

Also if there is a firewall try stopping the firewall and see the results.

Try telnet to the port from the server itself.

telnet localhost 8009

Open in new window

Hope this helps.
Duncan RoeSoftware DeveloperCommented:
As root, you can lsof -i to see more detail about listening ports. Note that telnet localhost 8009 only tells you if a process is listening on the local interface (shows as lo in ifconfig) and you want to know about eth0 or whatever. Frequently processes listen on all interfaces, but this isn't necessarily the case
I think it could be an issue with number of connections between apache and tomcat.
In tomcat you can add acceptCount attribute for the <Connector>. The defintion of that attribute is "The maximum queue length for incoming connection requests when all possible request processing threads are in use. Any requests received when the queue is full will be refused. Default value is 100" (check http://tomcat.apache.org/tomcat-6.0-doc/config/http.html for details)

Check the number of connections in Apache defined by MaxClients in your httpd.conf, default is 256. (check http://httpd.apache.org/docs/2.0/mod/mpm_common.html#maxclients).

If number of MaxClients is bigger that acceptCount then you can have such issues.
frankduxAuthor Commented:
Thank you for the verbose explanation. There was indeed a mismatch between the Apache thread connections and the Tomcat max connections.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now