I’m a newbie to apache/tomcat .<\/p>\n
I’m working on a setting up apache webserver Infront of the tomcat server, I have apache webserver on one host(10.176.165.21), and tomcat on a other host (10.176.165.22). Both are on OS RHEL 7.9.<\/p>\n
On the Web server host, I have installed the httpd and configured to connect with tomcat host. Sharing the config below.<\/p>\n
Apache version: Server version: Apache/2.4.6 (Red Hat Enterprise Linux)<\/p>\n
Tomcat Server version: Apache Tomcat/9.0.80<\/p>\n
/etc/httpd/conf.d/workers.properties:<\/p>\n
worker.list=worker1<\/p>\n
worker.worker1.type=ajp13
\nworker.worker1.host=10.176.165.22
\nworker.worker1.port=8009<\/p>\n
I’m using the modjk connector for establishing the connectivity b/n apacehe and tomcat.<\/p>\n
modjk config:<\/p>\n
LoadModule jk_module modules/mod_jk.so<\/p>\n
JkWorkersFile /etc/httpd/conf.d/workers.properties<\/p>\n
JkLogFile /var/log/httpd/mod_jk.log<\/p>\n
JkLogLevel info<\/p>\n
JkMount /* worker1<\/p>\n
Tomcat :<\/p>\n
On the tomcat host : the server config has below AJP connector config has been set.<\/p>\n\n
<\/p>\n
8009 port is listening on tomcat server and enabled in required firewalls.<\/p>\n
[Thu Oct 05 04:37:08.658 2023] [ZR51tP-yAAFF7pqs0XfINAAAAAM] [26749:140710419421312] [info] jk_open_socket::jk_connect.c (818): connect to 10.176.165.22:8009 failed (errno=111)
\n[Thu Oct 05 04:37:08.658 2023] [ZR51tP-yAAFF7pqs0XfINAAAAAM] [26749:140710419421312] [info] ajp_connect_to_endpoint::jk_ajp_common.c (1092): (worker1) Failed opening socket to (10.176.165.22:8009) (errno=111)
\n[Thu Oct 05 04:37:08.658 2023] [ZR51tP-yAAFF7pqs0XfINAAAAAM] [26749:140710419421312] [error] ajp_send_request::jk_ajp_common.c (1768): (worker1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
\n[Thu Oct 05 04:37:08.658 2023] [ZR51tP-yAAFF7pqs0XfINAAAAAM] [26749:140710419421312] [info] ajp_service::jk_ajp_common.c (2892): (worker1) sending request to tomcat failed (recoverable), because of error during request sending (attempt=1)<\/p>\n
I’m looking for help ,<\/p>\n
Thanks,<\/p>\n
Raj<\/p>","upvoteCount":5,"answerCount":2,"datePublished":"2023-10-05T11:02:48.000Z","author":{"@type":"Person","name":"spiceuser-lq2qu","url":"https://community.spiceworks.com/u/spiceuser-lq2qu"},"suggestedAnswer":[{"@type":"Answer","text":"
I’m a newbie to apache/tomcat .<\/p>\n
I’m working on a setting up apache webserver Infront of the tomcat server, I have apache webserver on one host(10.176.165.21), and tomcat on a other host (10.176.165.22). Both are on OS RHEL 7.9.<\/p>\n
On the Web server host, I have installed the httpd and configured to connect with tomcat host. Sharing the config below.<\/p>\n
Apache version: Server version: Apache/2.4.6 (Red Hat Enterprise Linux)<\/p>\n
Tomcat Server version: Apache Tomcat/9.0.80<\/p>\n
/etc/httpd/conf.d/workers.properties:<\/p>\n
worker.list=worker1<\/p>\n
worker.worker1.type=ajp13
\nworker.worker1.host=10.176.165.22
\nworker.worker1.port=8009<\/p>\n
I’m using the modjk connector for establishing the connectivity b/n apacehe and tomcat.<\/p>\n
modjk config:<\/p>\n
LoadModule jk_module modules/mod_jk.so<\/p>\n
JkWorkersFile /etc/httpd/conf.d/workers.properties<\/p>\n
JkLogFile /var/log/httpd/mod_jk.log<\/p>\n
JkLogLevel info<\/p>\n
JkMount /* worker1<\/p>\n
Tomcat :<\/p>\n
On the tomcat host : the server config has below AJP connector config has been set.<\/p>\n\n
<\/p>\n
8009 port is listening on tomcat server and enabled in required firewalls.<\/p>\n
[Thu Oct 05 04:37:08.658 2023] [ZR51tP-yAAFF7pqs0XfINAAAAAM] [26749:140710419421312] [info] jk_open_socket::jk_connect.c (818): connect to 10.176.165.22:8009 failed (errno=111)
\n[Thu Oct 05 04:37:08.658 2023] [ZR51tP-yAAFF7pqs0XfINAAAAAM] [26749:140710419421312] [info] ajp_connect_to_endpoint::jk_ajp_common.c (1092): (worker1) Failed opening socket to (10.176.165.22:8009) (errno=111)
\n[Thu Oct 05 04:37:08.658 2023] [ZR51tP-yAAFF7pqs0XfINAAAAAM] [26749:140710419421312] [error] ajp_send_request::jk_ajp_common.c (1768): (worker1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
\n[Thu Oct 05 04:37:08.658 2023] [ZR51tP-yAAFF7pqs0XfINAAAAAM] [26749:140710419421312] [info] ajp_service::jk_ajp_common.c (2892): (worker1) sending request to tomcat failed (recoverable), because of error during request sending (attempt=1)<\/p>\n
I’m looking for help ,<\/p>\n
Thanks,<\/p>\n
Raj<\/p>","upvoteCount":5,"datePublished":"2023-10-05T11:02:48.000Z","url":"https://community.spiceworks.com/t/apache-to-backend-tomcat-connection-failure-503-error/960268/1","author":{"@type":"Person","name":"spiceuser-lq2qu","url":"https://community.spiceworks.com/u/spiceuser-lq2qu"}},{"@type":"Answer","text":"
Hey there,<\/p>\n
two things seem off and worth looking into maybe.<\/p>\n
1.) This<\/p>\n
“[error] ajp_send_request::jk_ajp_common.c (1768): (worker1) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)”<\/p>\n
kinda gives the impression the TomCat service ain’t running or is hanging. Try restarting/starting it (systemctl restart/start …)<\/p>\n
2.) in your Tomcat config you loopback is set as “::1” which is IPv6, but you don’t seem to use IPv6 here anywhere apparently. Try setting it to “127.0.0.1” or “localhost” (the IPv4 equivalent of “::1”)<\/p>\n
Good luck<\/p>\n
jas<\/p>","upvoteCount":0,"datePublished":"2023-10-06T12:57:43.000Z","url":"https://community.spiceworks.com/t/apache-to-backend-tomcat-connection-failure-503-error/960268/2","author":{"@type":"Person","name":"jspr","url":"https://community.spiceworks.com/u/jspr"}}]}}