- Operative System: Ubuntu Server 18.04.4 LTS
- Apache Version: 2.4.29-1ubuntu4.12
- Apache Tomcat: 8.5.39-1ubuntu1~18.04.3
- Apache Mod JK: 1:1.2.43-1
First of all I read many technical document from Debian/Ubuntu and Redhat, in theory if the firewall is enable and not let out the port 8009, the vulnerability is mitigated.
But as we use AJP, we prefer enable the mitigation through password too.
I test the mitigation in Windows Servers with the same version of apache, tomcat and mod_jk and works, but when I test the same config in Ubuntu Server, the comunication between apache and tomcat trought AJP not happen.
What could be my error?
The trace of error in Mod JK is this:
[Tue Mar 03 16:11:18.102 2020] [28055:139750426003200] [info] jk_open_socket::jk_connect.c (817): connect to ::1:8009 failed (errno=111)
[Tue Mar 03 16:11:18.102 2020] [28055:139750426003200] [info] ajp_connect_to_endpoint::jk_ajp_common.c (1068): (ajp13_worker) Failed opening socket to (::1:8009) (errno=111)
[Tue Mar 03 16:11:18.102 2020] [28055:139750426003200] [error] 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)
[Tue Mar 03 16:11:18.102 2020] [28055:139750426003200] [info] ajp_service::jk_ajp_common.c (2778): (ajp13_worker) sending request to tomcat failed (recoverable), because of error during request sending (attempt=1)
[Tue Mar 03 16:11:18.202 2020] [28055:139750426003200] [info] jk_open_socket::jk_connect.c (817): connect to ::1:8009 failed (errno=111)
[Tue Mar 03 16:11:18.202 2020] [28055:139750426003200] [info] ajp_connect_to_endpoint::jk_ajp_common.c (1068): (ajp13_worker) Failed opening socket to (::1:8009) (errno=111)
[Tue Mar 03 16:11:18.202 2020] [28055:139750426003200] [error] 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)
[Tue Mar 03 16:11:18.202 2020] [28055:139750426003200] [info] ajp_service::jk_ajp_common.c (2778): (ajp13_worker) sending request to tomcat failed (recoverable), because of error during request sending (attempt=2)
[Tue Mar 03 16:11:18.202 2020] [28055:139750426003200] [error] ajp_service::jk_ajp_common.c (2799): (ajp13_worker) connecting to tomcat failed (rc=-3, errors=3, client_errors=0).
[Tue Mar 03 16:11:18.203 2020] [28055:139750426003200] [info] jk_handler::mod_jk.c (2995): Service error=-3 for worker=ajp13_worker
Document for mitigation: https://access.redhat.com/solutions/4851251
Resume of task:
Modify server.xml
<Connector port="8009"
protocol="AJP/1.3"
redirectPort="8443"
requiredSecret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
Workers.properties
workers.tomcat_home=/usr/share/tomcat8
workers.java_home=/usr/lib/jvm/default-java
ps=/
worker.list=ajp13_worker
worker.ajp13_worker.port=8009
worker.ajp13_worker.host=localhost
worker.ajp13_worker.type=ajp13
#worker.ajp13_worker.secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
worker.ajp13_worker.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=ajp13_worker
#worker.loadbalancer.secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
configure jk-status
#worker.list=jk-status
#worker.jk-status.type=status
#worker.jk-status.read_only=true
configure jk-manager
#worker.list=jk-manager
#worker.jk-manager.type=status
I thank you for any help you can give me on the subject.