apache to backend tomcat connection failure 503 error

118 views Asked by At

I'm working on a apace - tomcat config setup, 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.

On the Web server host, I have installed the httpd and configured to connect with tomcat host.

Apache version: Server version: Apache/2.4.6 (Red Hat Enterprise Linux) Tomcat Server version: Apache Tomcat/9.0.80.

/etc/httpd/conf.d/workers.properties:

worker.list=worker1

worker.worker1.type=ajp13
worker.worker1.host=10.176.165.22
worker.worker1.port=8009

Using the modjk connector for establishing the connectivity b/n apache and tomcat.

modjk config:
# Load mod_jk module
LoadModule jk_module modules/mod_jk.so

# Specify the workers for Tomcat instances
JkWorkersFile /etc/httpd/conf.d/workers.properties

# Configure the mod_jk log file
JkLogFile /var/log/httpd/mod_jk.log

# Set the log level
JkLogLevel info

# Mount your web application to Tomcat
JkMount /* worker1

Tomcat :

On the tomcat host : the server.xml config file has below AJP connector config has been set.

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector protocol="AJP/1.3"
           address="::1"
           port="8009"
           maxParameterCount="1000"
           />

8009 port is listening on tomcat server and enabled in required firewalls.

After all I'm getting the below errors in mod_jk logs.

[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)
[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)
[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)
[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)

Please help me in this case.

Thanks.

1

There are 1 answers

1
Raboddep boddep On

address="::1" - refers to ipv6 . changed the above to address="0.0.0.0" or ipv4 - the communication started working.