We have a JBoss production on which our Java application is running. We have configured an Apache Server(DMZ) to route the traffic to JBoss production server and to increase security. We have used Apache's mod_jk module for routing to production and Apache version 2.2. It was working fine for few months but for some time we are having this error:
Bad Gateway
The proxy server received an invalid response from upstream server.
My worker.property on Apache is:
worker.list=ws
worker.ws.port=8009
worker.ws.host=192.168.56.102
worker.ws.type=ajp13
My httpd.conf file has following virtual host for this worker:
<virtualhost *:443>
ErrorLog "logs/dmz-error.log"
CustomLog "logs/dmz-access.log" common
JkMount /ws/ ws
JkMount /* ws
JkLogFile logs/mod_jk_prod.log
JkLogLevel error
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompatUnparsed -ForwardDirectories
JkRequestLogFormat "%w %V %T"
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
</virtualhost>
JBoss is running on default configuration. This system was running with an old Apache version with same configurations and routing. But we needed to replace the Apache machine and also we were requested to upgrade Apache to 2.2 version. We are facing this problem for almost 2 months. Mod_jk log shows following error:
[Tue Sep 23 11:52:01 2014][1392:1900] [error] ajp_get_reply::jk_ajp_common.c (2126): (ws) Tomcat is down or refused connection. No response has been sent to the client (yet)
[Tue Sep 23 11:52:01 2014][1392:4028] [error] ajp_get_reply::jk_ajp_common.c (2126): (ws) Tomcat is down or refused connection. No response has been sent to the client (yet)
We cannot find any solution for this problem. When this error is shown, refreshing the page for few times resolves it but some times, we cannot access our application. How can I know the actual cause of this error? Some body please help.