I tried using Tomcat 9 with mod_jk but it failed. The same configurations and same Ports work for Tomcat 8 but did not work for Tomcat 9. It gets stuck in the connection state while redirecting me to the appropriate port and never redirected me to any appropriate port. I looked at mod_jk.log and error.log in Apache 2.2 logs folder, but no error seems. Here are my workers.properties file and server.xml files that I use. As I said, I installed Tomcat 8 on the same computer, it works and load balancing very well with the same configs and works on the same ports. Do you have any suggestions?
Apache HttpServer 2.2 Mod_jk 1.2.40
worker.instance1.type=ajp13
worker.instance1.host=127.0.0.1
worker.instance1.port=7009
worker.instance1.lbfactor=1
worker.instance1.connection_pool_timeout=600
worker.instance1.socket_timeout=300
# Instance2
worker.instance2.type=ajp13
worker.instance2.host=127.0.0.1
worker.instance2.port=6009
worker.instance2.lbfactor=1
worker.instance2.connection_pool_timeout=600
worker.instance2.socket_timeout=300
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=instance1,instance2
worker.loadbalancer.sticky_session=1
worker.list=loadbalancer,jkstatus
worker.jkstatus.type=status
And my 7009 server.xml's like
<!-- Define an AJP 1.3 Connector on port 7009 -->
<Connector port="7009" protocol="AJP/1.3" redirectPort="8043" />
<Engine name="Catalina" defaultHost="127.0.0.1" jvmRoute="instance2">
And my 6009 server.xml's like
<!-- Define an AJP 1.3 Connector on port 6009-->
<Connector port="6009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="127.0.0.1" jvmRoute="instance1">
Since Tomcat 9.0.31, the AJP connector's
secretRequiredattribute defaults totrue, so that you need to configure a common secret on both, Tomcat and httpd side. You didn't need to do that on older setups.You can check the change log, (Ctrl+F secretRequired) and the AJP connector's documentation (same search term) for more details.
Not sure why this is not logged though.