简体   繁体   English

在tomcat上运行的Java应用程序。 无法通过ajp访问。

[英]java application running on tomcat. Unable to access over ajp.

Application is accessible over tomcat http port. 可通过tomcat http端口访问应用程序。 Application when accessed from web server(Apache http server) gives bad gateway error. 从Web服务器(Apache http服务器)访问应用程序时,网关错误。 worker.properties(apache http server) & server.xml(tomcat) are tuned well. 对worker.properties(Apache http服务器)和server.xml(tomcat)进行了很好的调整。 Socket/connection timeout is 20 sec on both sides. 双方的套接字/连接超时均为20秒。

Jk.log shows below error. Jk.log显示以下错误。 enter image description here 在此处输入图片说明

The error says tomcat is not accepting any connections. 该错误表明tomcat不接受任何连接。 But how come at the same time, application is accessible over http. 但是同时又可以通过http访问应用程序。

On tomcat side I dont see any errors in the log. 在tomcat方面,我在日志中看不到任何错误。

You use different ports for HTTP connection (default is 8080) and for AJP connection (default is 8009). 您使用不同的端口进行HTTP连接(默认为8080)和AJP连接(默认为8009)。 You can check exact values in conf/server.xml . 您可以在conf/server.xml检查确切的值。

Your error indicates that there are some problems between httpd and client (firewall, slow connection etc.). 您的错误表明httpd和客户端之间存在一些问题(防火墙,连接缓慢等)。 Try to remove timeouts, like worker.ajp13.socket_timeout=3 . 尝试删除超时,例如worker.ajp13.socket_timeout=3 ( https://tomcat.apache.org/connectors-doc/common_howto/timeouts.html ) https://tomcat.apache.org/connectors-doc/common_howto/timeouts.html

Make sure that ports are not blocked by possible firewalls. 确保端口未被可能的防火墙阻止。 For Ubuntu, UFW (Uncomplicated Firewall) could be used to open AJP connections: ufw enable && ufw allow 8009 . 对于Ubuntu,可以使用UFW(非复杂防火墙)打开AJP连接: ufw enable && ufw allow 8009

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM