I've configured Apache tomcat7 as backend & apache2.2 as frontend both on same CentOS 6 server & here is part of my configurations:
In Server.xml I have:

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" connectionTimeout="600000" maxKeepAliveRequests="100" URIEncoding="UTF-8"/>

& in httpd.conf:

ProxyRequests Off
Timeout 600
ProxyTimeout 600
ProxyPass / ajp://localhost:8009/
ProxyPassReverse / ajp://localhost:8009/

The problem is that some servlets on my tomcat server takes about 3 minutes to complete, but after one minute the opened socket to server (no matter what client I use, whether browser or any other client application) is closed by server unexpectedly (anyway, servlet execution continues until the end, even after socket was closed).
In sysctl.conf I changed value for net.ipv4.tcp_fin_timeout to 600 and I'm sure that it's not an OS timeout problem, because when I access another time-consuming script without mod_proxy (e.g. a PHP script with 3 minutes execution time on same apache server), it works fine with all clients.
Any suggestion will be appreciated


Try setting up connection timeout in Proxy directive like below

ProxyPass / ajp://localhost:8009/ connectiontimeout=600 timeout=600
ProxyPassReverse / ajp://localhost:8009/ 

I used these settings for my App and it was working fine

  • I've already tried it with no difference in the result! – Ehsan Khodarahmi Sep 25 '16 at 9:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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