I don't use AJP for load-balancing; I have a single Apache 2.2 instance that proxies some URLs to a single Tomcat 7 instance via AJP.

When Tomcat is down, the AJP proxy becomes disabled on the first failed request, and is not re-enabled when Tomcat is brought back up.

Is it possible to instruct Apache to not disable AJP connection, even though the backend is down, so that the proxy starts working the moment the backend is back online?

Here's an excerpt from my httpd.conf:

ProxyPass /my-web-app ajp://localhost:8009/my-we-app-1.0.2

And here's the log file when the backend is down:

[error] (OS 10061)No connection could be made because the target machine actively refused it.
[error] ap_proxy_connect_backend disabling worker for (localhost)
[error] proxy: AJP: failed to make connection to backend: localhost
link|improve this question
feedback

1 Answer

up vote 4 down vote accepted

Sure; instruct Apache to never wait to retry that backend connection (it's waiting 60 seconds, by default) with retry=0:

ProxyPass /my-web-app ajp://localhost:8009/my-we-app-1.0.2 retry=0
link|improve this answer
Awesome, that's what I needed, thanks. Never tried waiting >60 seconds, too impatient for that :D – RustyX Jan 13 at 19:31
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.