diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2014-04-02 17:04:18 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2014-04-02 17:04:18 +0200 |
commit | 5d8648c8192379922d6e3485051548f0955baefa (patch) | |
tree | 09f7e06fa728cf06fbebccedc74bfb9fad160bbe /sonar-application/src/main | |
parent | b863d3fb4ceb9b0a34a8455d7a7263460d4b7807 (diff) | |
parent | 22cd25e7b80e2f7f6acd5388ca9580afbf603c2b (diff) | |
download | sonarqube-5d8648c8192379922d6e3485051548f0955baefa.tar.gz sonarqube-5d8648c8192379922d6e3485051548f0955baefa.zip |
Merge branch 'master' of github.com:red6/sonar into red6-master
Diffstat (limited to 'sonar-application/src/main')
-rw-r--r-- | sonar-application/src/main/assembly/conf/sonar.properties | 4 | ||||
-rw-r--r-- | sonar-application/src/main/java/org/sonar/application/Connectors.java | 17 |
2 files changed, 19 insertions, 2 deletions
diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties index 07fb50c7c18..6c058aa3227 100644 --- a/sonar-application/src/main/assembly/conf/sonar.properties +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -163,6 +163,10 @@ sonar.jdbc.timeBetweenEvictionRunsMillis=30000 # Access logs are enabled by default. #sonar.web.accessLogs.enable=true +# TCP port for incoming AJP connections. Disabled when value is -1. +# sonar.ajp.port=9009 + + #-------------------------------------------------------------------------------------------------- # UPDATE CENTER 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 3011fc00f80..68c216fe516 100644 --- a/sonar-application/src/main/java/org/sonar/application/Connectors.java +++ b/sonar-application/src/main/java/org/sonar/application/Connectors.java @@ -30,6 +30,7 @@ class Connectors { private static final int DISABLED_PORT = -1; static final String HTTP_PROTOCOL = "HTTP/1.1"; + static final String AJP_PROTOCOL = "AJP/1.3"; static void configure(Tomcat tomcat, Props props) { configureShutdown(tomcat, props); @@ -38,7 +39,7 @@ class Connectors { private static void configureConnectors(Tomcat tomcat, Props props) { List<Connector> connectors = new ArrayList<Connector>(); - connectors.addAll(Arrays.asList(newHttpConnector(props), newHttpsConnector(props))); + connectors.addAll(Arrays.asList(newHttpConnector(props), newAjpConnector(props), newHttpsConnector(props))); connectors.removeAll(Collections.singleton(null)); verify(connectors); @@ -57,7 +58,7 @@ class Connectors { for (Connector connector : connectors) { int port = connector.getPort(); if (ports.contains(port)) { - throw new IllegalStateException(String.format("HTTP and HTTPS must not use the same port %d", port)); + throw new IllegalStateException(String.format("HTTP, AJP and HTTPS must not use the same port %d", port)); } ports.add(port); } @@ -87,6 +88,18 @@ class Connectors { } @Nullable + private static Connector newAjpConnector(Props props) { + Connector connector = null; + int port = props.intOf("sonar.ajp.port", DISABLED_PORT); + if (port > DISABLED_PORT) { + connector = newConnector(props, AJP_PROTOCOL, "http"); + connector.setPort(port); + info("AJP connector is enabled on port " + port); + } + return connector; + } + + @Nullable private static Connector newHttpsConnector(Props props) { Connector connector = null; int port = props.intOf("sonar.web.https.port", DISABLED_PORT); |