Apache (httpd) Proxy of Tomcat Continually Timing Out
I've c开发者_开发问答onfigured an Apache (httpd version 2.2) server as a proxy on CentOS version 5 for Tomcat (6.0.26) using the directives below. Unfortunately, every request is timing out. I've checked both httpd and tomcat logs and there are no errors. Anyone know what could be wrong? Thanks.
ProxyPass /ws-app http://xxx.xxx.xxx.xxx:8080/ws-app
ProxyPassReverse /ws-app http://xxx.xxx.xxx.xxx:8080/ws-app
When I enter url -- http://xxx.xxx.xxx.xxx/ws-app/user/list
I expect an array of users in xml format. Unfortunately, rather I'm getting:
The connection has timed out
The server at xxx.xxx.xxx.xxx is taking too long to respond.
It is very uncommon to proxy the connection to the Tomcat HTTP connector. Why don't you use the AJP connector? This will bring much more performance!
Make sure you have this in your server.xml
:
<Connector port="8009" redirectPort="8443" protocol="AJP/1.3" />
Then install mod_proxy_ajp
and use the following configuration:
ProxyPass /ws-app ajp://xxx.xxx.xxx.xxx:8009/ws-app
ProxyPassReverse /ws-app ajp://xxx.xxx.xxx.xxx:8009/ws-app
Please also check that the connection to port 8009 on the remote host is not blocked by a firewall.
精彩评论