AJP 1.3 Connector listens on port 8009 globally, why and how to turn it off?
Asked Answered
R

2

11

I set up a Tomcat 6 with an Apache 2 and mod_proxy. Now I have this default value in my server.xml:

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

netstat looks like this:

Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      4703/apache2    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1020/sshd       
tcp        0      0 127.0.0.1:8005          0.0.0.0:*               LISTEN      10517/java      
tcp        0      0 0.0.0.0:8009            0.0.0.0:*               LISTEN      10517/java      
tcp        0      0 127.0.0.1:8009          127.0.0.1:48704         ESTABLISHED 10517/java      
tcp        0      0 127.0.0.1:48704         127.0.0.1:8009          ESTABLISHED 11696/apache2   

My question's now, is there a necessarity for AJP to listen on port 8009 globally, I don't think so?! And how to turn it off?

Reata answered 16/6, 2011 at 8:58 Comment(2)
They really should add a property to reassign this.Cephalopod
Oh boy, and now, almost 9 years later we get the ghostcat vulnerability targeting exactly this...Milks
H
6

You can comment out this connector from server.xml. It is used by mod_jk, mod_proxy does not need this port (it uses standard HTTP Tomcat connector, 8080 port by default).However, mod_jk is sometimes preferred over mod_proxy.

Hance answered 16/6, 2011 at 9:5 Comment(1)
I'm using mod_proxy_ajp, as soon as I uncomment the line the server is no longer reachable. I disabled Tomcat on 8080, only want to use Apache. But I've just found the answer RTFM once again, shame on me.. just have to add this <Connector port="8009" address="127.0.0.1" protocol="AJP/1.3" redirectPort="8443" />Reata
T
3

Try adding address="desired local address" to the Connector. This specifies that a particular local address is to be used when binding the Socket Listener.

Taiwan answered 17/10, 2013 at 16:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.