diff options
-rw-r--r-- | sonar-application/src/main/assembly/conf/sonar.properties | 6 | ||||
-rw-r--r-- | sonar-application/src/main/java/org/sonar/application/Connectors.java | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties index 3c4b407266b..6f4308af6c9 100644 --- a/sonar-application/src/main/assembly/conf/sonar.properties +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -86,8 +86,10 @@ sonar.jdbc.timeBetweenEvictionRunsMillis=30000 #-------------------------------------------------------------------------------------------------- # WEB SERVER -# Binding address -#sonar.web.host=0.0.0.0 +# Binding IP address. For servers with more than one IP address, this property specifies which +# address will be used for listening on the specified ports. +# By default, ports will be used on all IP addresses associated with the server. +#sonar.web.host= # Web context. When set, it must start with forward slash (for example /sonarqube). # The default value is root context (empty value). diff --git a/sonar-application/src/main/java/org/sonar/application/Connectors.java b/sonar-application/src/main/java/org/sonar/application/Connectors.java index 684d17c9b11..0a4bcd8c3c9 100644 --- a/sonar-application/src/main/java/org/sonar/application/Connectors.java +++ b/sonar-application/src/main/java/org/sonar/application/Connectors.java @@ -35,7 +35,6 @@ class Connectors { static final String HTTP_PROTOCOL = "HTTP/1.1"; static void configure(Tomcat tomcat, Props props) { - tomcat.getServer().setAddress(props.of("sonar.web.host", "0.0.0.0")); configureShutdown(tomcat, props); configureConnectors(tomcat, props); } @@ -105,6 +104,7 @@ class Connectors { private static Connector newConnector(Props props, String protocol, String scheme) { Connector connector = new Connector(protocol); connector.setURIEncoding("UTF-8"); + connector.setProperty("address", props.of("sonar.web.host")); configurePool(props, connector, scheme); configureCompression(connector); return connector; |