Tomcat AJP with Lucee Setup

TLDR; If you copy and paste setup code from tutorials, you may find that your Tomcat is not responding to port 8009. And no matter what combination of address=“::”… “0.0.0.0”… etc you use, the port still will not respond and apache error log will show:

[Sun Nov 24 22:38:51.560043 2024] [proxy_ajp:error] [pid 285198:tid 285338] [client 192.168.8.1:65160] AH00896: failed to make connection to backend: example.com, referer: http://example.com/
[Sun Nov 24 22:38:51.559939 2024] [proxy:error] [pid 285198:tid 285338] (111)Connection refused: AH00957: AJP: attempt to connect to X.X.X.X:8009 (example.com:8009) failed

Check your tomcat.service file for this and remove it:

-Djava.net.preferIPv4Stack=true

I am in the process of learning how to manually setup Tomcat9 using the Lucee.war file. I must say I have some experience setting up other .war packages this way as well. And today, I ran into a road block that took me sometime to figure out what was going on and how to fix it, and though I should share it to help anyone else trying to do so.

There are not to many help sites out there that go over how to install tomcat9 on Rocky9 (or any CentOS 9 releases). The one I did find went over installing 10. So I followed that one. After getting all things setup, I could not get the Lucee page to show, all I would get is the Service not available page and the apache error line shown above. NMAP was also showing the port 8009 was closed.

So I went to some of my older systems (Centos8) and copied the tomcat.service settings I had used there (and probably should have done so in the 1st place).
After comparing and testing what different configs between the old and the help page, I found the above marked line to be the issue. And once removed, all was well.

1 Like