[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

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

apache tomcat timeout log messages

I've search and found a bit of discussion on this subject previously, but unfortunately I've not gotten the answers I need fully...

We have apache on one server setup with proxypass to another server running tomcat... much of the time, all works well, but other times we get continual log messages as below:

(70007)The timeout specified has expired: ajp_ilink_receive() can't receive header
[Tue Feb 10 07:48:37 2009] [error] ajp_read_header: ajp_ilink_receive failed
[Tue Feb 10 07:48:37 2009] [error] (120006)APR does not understand this error code: proxy: read response failed from XXX.XXX.XXX::9020 (XXX.XXX.XXX)  

Anyhow, using ProxyPass with ajp in httpd.conf...   Apache v2.2.2

I've read that these errors might be fixed by switching from mod_proxy to mod_jk, OR switching from ajp to http in ProxyPass (as we don't need ajp for loadbalancing at present) OR upgrading to apache 2.2.9...  but not sure what t to try.   And does anyone know what causes them?

I can provide additional configuration code to review as needed.   Really needing to resolve this... Thanks

  • 3
  • 2
1 Solution
Updating to 2.2.11 is aways a good idea since other bugs and may be security related issues could be fixed 2,5 years after 2.2.2, too.

> what causes them?

The source seems to live in ajp_link.c, function ilink_read() fails. Looks like the function opens a socket (apr_socket_recv) which goes wrong someway due to a timeout.
yukhntr2Author Commented:
Ok, thanks for the suggestion.  Updating to 2.2.9 or 2.2.11 is going to be harder as I'm at the mercy of using 'approved' software releases.  Do either of the other options I mention, either switching from ajp to http in ProxyPass or using mod_jk instead of mod_proxy seem likely to work?  Or is there another option out there that may be configuration based?
The alternatives should work, yes (unless there's a problem on the tomcat side). I don't know the ajp protocol well, so I don't know what that function should do exactly. May be it opens the ajp connection, may be something else. mod_jk uses ajp to connect to tomcat as well, but has a different source then mod_proxy_ajp of course if the error is somewhere in mod_proxy_ajp.

I'd try mod_jk since the ajp connection is considered to be faster than a reverse proxy via http.
yukhntr2Author Commented:
first I'd like to try swapping http for ajp in my proxypass defintion, but is that all there is to it?  Do I need proxypassreverse then?
ProxyPass /8711 ajp://XX.XXX.XXX.XXX:9017/8711
ProxyPass /8711 http://XX.XXX.XXX.XXX:9017/8711

Aside from speed, any negative from switching from ajp to http?

> Do I need proxypassreverse then?

If your application issues redirects (Location: header), yes.

> Aside from speed, any negative from switching from ajp to http?

I don't know if you can access request.getRemoteUser() if you're using authentication on the apache side.

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

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