0

We've configured Apache to redirect to an instance of tomcat through a diferent port of the AJP default 8009 . It only works for the default port but it's not working with the one we set (8109) on the worker.properties This is our scenario

worker.properties on /etc/apache2

worker.list=sacmimexico
# Set properties for sacmimexico
worker.sacmimexico.type=ajp13
worker.sacmimexico.host=localhost
worker.sacmimexico.port=8109

server.xml on /usr/share/instance-tomcat-7.0.42/sacmimexico/conf/

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8109" protocol="AJP/1.3" redirectPort="8143" />

mod_jk.log on /var/log/apache2

[Wed Oct 14 05:29:18 2015] [17752:140024424515392] [info] init_jk::mod_jk.c (3189): mod_jk/1.2.30 initialized
[Wed Oct 14 05:29:18 2015] [17753:140024424515392] [info] init_jk::mod_jk.c (3189): mod_jk/1.2.30 initialized
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [info] jk_open_socket::jk_connect.c (622): connect to 127.0.0.1:8009 failed (errno=111)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [info] ajp_connect_to_endpoint::jk_ajp_common.c (959): Failed opening socket to (127.0.0.1:8009) (errno=111)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [error] ajp_send_request::jk_ajp_common.c (1585): (sacmimexico) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [info] ajp_service::jk_ajp_common.c (2540): (sacmimexico) sending request to tomcat failed (recoverable), because of error during request sending (attempt=1)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [info] jk_open_socket::jk_connect.c (622): connect to 127.0.0.1:8009 failed (errno=111)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [info] ajp_connect_to_endpoint::jk_ajp_common.c (959): Failed opening socket to (127.0.0.1:8009) (errno=111)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [error] ajp_send_request::jk_ajp_common.c (1585): (sacmimexico) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [info] ajp_service::jk_ajp_common.c (2540): (sacmimexico) sending request to tomcat failed (recoverable), because of error during request sending (attempt=2)
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [error] ajp_service::jk_ajp_common.c (2559): (sacmimexico) connecting to tomcat failed.
[Wed Oct 14 05:29:22 2015] sacmimexico 199.187.122.163 0.100588
[Wed Oct 14 05:29:22 2015] [17757:140024328361728] [info] jk_handler::mod_jk.c (2618): Service error=-3 for worker=sacmimexico

jk.conf on /etc/apache2/mods-available

<IfModule mod_jk.c>
 JkWorkersFile "/etc/apache2/workers.properties"
 JkLogFile "/var/log/apache2/mod_jk.log"
 JkLogLevel info
 JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
 JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
 JkRequestLogFormat "%w %V %T"
</IfModule>

default on /etc/apache2/sites-available

JkMount /sacmimexico/* sacmimexico

Versions:

Apache 2 :Apache/2.2.16 (Debian)

Tomcat 7 : Apache Tomcat/7.0.42

mod-jk : 1.2.30-1squeeze1

We know that Tomcat is working on that port 8109 Anyone knows what's happening?

Thanks

Albert

Albert Rubio
  • 1
  • 1
  • 1

2 Answers2

0

The problem were wrong carachters on workers.properties due to bad edit. I check it with cat -A workers.properties and then create a new one from scratch.

Albert Rubio
  • 1
  • 1
  • 1
0

I faced the exact same issue. The fix for this issue is to change the AJP port to a different range. The port 8109 was getting blocked by SELinux in my CentOS /Red Hat. So I changed the AJP port to 81 on woker.proberties as well as Tomcat server.xml. Thus the issue got fixed.

Ajith George
  • 869
  • 8
  • 8