Hi all

I¹ve noticed an unexpected and undocumented behaviour in the AJP connector
in Tomcat 5.5.27.
I¹ve configured the AJP connector to run on port 8009, which is occupied by
another process, but instead of failing the connector continues to scan
until it hits a free port and uses that. Inspection of the source confirms
that the coded behaviour is to scan up to the configured port + 10 to find a
free port.

I can¹t find any reference to this in the documentation, and I¹m struggling
to understand why this is the intended behaviour ­ there¹s nothing in mod_jk
that I know of that would reciprocate the port scanning to ensure the newly
started AJP connector actually got wired to something (and even if there
was, there¹s no way that¹d be safe since it could run into other apps
running on the ports the Tomcat side skipped).

There are comments in the code that indicate that setting maxPort on the
connector to 0 enables Œbackward compatibility¹ by disabling the scanning,
but this doesn¹t seem to work via server.xml.

Can anyone shed light on the decisions behind this behaviour, and what one
can do to get the AJP connector to start on a predictable port?

cheers
tim

Reply via email to