Change the default bind address for AJP to the loopback address · apache/tomcat@0e8a50f · GitHub
Skip to content

Commit

Permalink
Change the default bind address for AJP to the loopback address
Browse files Browse the repository at this point in the history
  • Loading branch information
markt-asf committed Feb 4, 2020
1 parent 4c933d8 commit 0e8a50f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions java/org/apache/coyote/ajp/AbstractAjpProtocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
package org.apache.coyote.ajp;

import java.net.InetAddress;

import org.apache.coyote.AbstractProtocol;
import org.apache.coyote.Processor;
import org.apache.coyote.UpgradeProtocol;
Expand Down Expand Up @@ -46,6 +48,8 @@ public AbstractAjpProtocol(AbstractEndpoint<S,?> endpoint) {
setConnectionTimeout(Constants.DEFAULT_CONNECTION_TIMEOUT);
// AJP does not use Send File
getEndpoint().setUseSendfile(false);
// AJP listens on loopback by default
getEndpoint().setAddress(InetAddress.getLoopbackAddress());
ConnectionHandler<S> cHandler = new ConnectionHandler<>(this);
setHandler(cHandler);
getEndpoint().setHandler(cHandler);
Expand Down
4 changes: 4 additions & 0 deletions webapps/docs/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@
Disable (comment out in server.xml) the AJP/1.3 connector by default.
(markt)
</update>
<update>
Change the default bind address for the AJP/1.3 connector to be the
loopback address. (markt)
</update>
</changelog>
</subsection>
<subsection name="Jasper">
Expand Down
5 changes: 1 addition & 4 deletions webapps/docs/config/ajp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,7 @@
<attribute name="address" required="false">
<p>For servers with more than one IP address, this attribute
specifies which address will be used for listening on the specified
port. By default, this port will be used on all IP addresses
associated with the server. A value of <code>127.0.0.1</code>
indicates that the Connector will only listen on the loopback
interface.</p>
port. By default, the loopback address will be used.</p>
</attribute>

<attribute name="bindOnInit" required="false">
Expand Down

0 comments on commit 0e8a50f

Please sign in to comment.