0

I'm following this guide to setup Tomcat 8 on Ubuntu Server 16.04 using Apache2's mod_jk module as a reverse proxy:

https://www.digitalocean.com/community/tutorials/how-to-encrypt-tomcat-8-connections-with-apache-or-nginx-on-ubuntu-16-04

Everything works until the last step, which is to change the HTTP and AJP Connectors in server.xml to only listen on localhost. Here's the change I made to the AJP Connector:

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

Before this change, typing https://myhostname takes me to the Tomcat administration page; after it, I get "503 Service Unavailable". I've temporarily turned off my firewall and removed AppArmor. Here's the relevant portion of mod_jk.log:

jk_open_socket::jk_connect.c (817): connect to ::1:8009 failed (errno=111)
ajp_connect_to_endpoint::jk_ajp_common.c (1068): (ajp13_worker) Failed opening socket to (::1:8009) (errno=111)
ajp_send_request::jk_ajp_common.c (1728): (ajp13_worker) connecting to backend failed. Tomcat is probably not started or is listening on the wrong port (errno=111)

What could be causing this, and how can I resolve it?

0

Your definition in the connector is address="127.0.0.1".
The error message shows ::1:8009

For me, that looks like tomcat is listening in IPv4 address 127.0.0.1 but you're connecting with IPv6 to ::1

I think that could be problem. Perhaps you could connect direct to http://127.0.0.1 and not to https://myhostname. I assume myhostname is translated to the IPv6 localhost address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.