简体   繁体   English

mod_jk 无法连接 Apache 和 tomcat

[英]mod_jk not able to connect Apache and tomcat

I am not able to connect my Apache to tomcat servers.我无法将我的 Apache 连接到 tomcat 服务器。 Below are the version details.以下是版本详细信息。 mod_jk/1.2.39 Apache-2.4.41 tomcat-9.0.31 mod_jk/1.2.39 Apache-2.4.41 tomcat-9.0.31

I have created Workers.properties file and mentioned my hostname and AJP port ie 8009 and also enabled Ajp connectors from tomcat side.我创建了 Workers.properties 文件并提到了我的主机名和 AJP 端口,即 8009,并且还从 tomcat 端启用了 Ajp 连接器。 Issue I am facing is mod_jk is not connecting to host that I have provided in workers.properties file.我面临的问题是 mod_jk 没有连接到我在workers.properties 文件中提供的主机。 Instead of that it is connecting to 0.0.0.0.相反,它连接到 0.0.0.0。 Below is the error from mod_jk.log以下是来自 mod_jk.log 的错误

[Wed May 27 12:52:00 2020] [6902:140379841652544] [info] init_jk::mod_jk.c (3383): mod_jk/1.2.39 initialized
[Wed May 27 12:52:00 2020] [6903:140379841652544] [info] init_jk::mod_jk.c (3383): mod_jk/1.2.39 initialized
[Wed May 27 12:53:20 2020] [6906:140379663890176] [info] jk_open_socket::jk_connect.c (735): connect to 0.0.0.0:8009 failed (errno=111)
[Wed May 27 12:53:20 2020] [6906:140379663890176] [info] ajp_connect_to_endpoint::jk_ajp_common.c (1019): Failed opening socket to (0.0.0.0:8009) (errno=111)
[Wed May 27 12:53:20 2020] [6906:140379663890176] [error] ajp_send_request::jk_ajp_common.c (1659): (tomcat1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)

I have checked I can access my tomcat servers and it's running fine.我已经检查我可以访问我的 tomcat 服务器并且它运行良好。 Below is the Ajp connectors from tomcat server下面是来自 tomcat 服务器的 Ajp 连接器

<Connector protocol="AJP/1.3"
               address="::1"
               port="8009"
               redirectPort="8443" />

Is there anything I am missing or is it some kind of fat bug involve with this version of mod_jk?有什么我遗漏的,还是这个版本的 mod_jk 涉及某种胖错误? Any kind of Suggestion and Help will be appreciated.任何形式的建议和帮助将不胜感激。

Thanks, Anshu谢谢,安舒

Start tomcat server on IP address instead of 0.0.0.0.在 IP 地址而不是 0.0.0.0 上启动 tomcat 服务器。

<Connector protocol="AJP/1.3"
               address="IP-address"
               port="8009"
               redirectPort="8443" />

Use tomcat-adress and Port in worker.properties.在 worker.properties 中使用 tomcat-adress 和 Port。 Restart tomcat and Apache service.重启 tomcat 和 Apache 服务。 Also make sure that port 8009 is open between Apache and tomcat server.还要确保在 Apache 和 tomcat 服务器之间打开端口 8009。

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

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