ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dillido...@apache.org
Subject [1/2] incubator-ranger git commit: RANGER-374: ranger admin need to support AJP connector to work behind SSL enabled Apache Load Balancer
Date Tue, 07 Apr 2015 20:08:32 GMT
Repository: incubator-ranger
Updated Branches:
  refs/heads/master b253a4e2d -> aae97d767


RANGER-374: ranger admin need to support AJP connector to work behind SSL enabled Apache Load
Balancer


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/63399d07
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/63399d07
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/63399d07

Branch: refs/heads/master
Commit: 63399d07da7da6b957f1f4f2f7a85a668e191117
Parents: 53709aa
Author: Dilli Dorai Arumugam <darumugam@hortonworks.com>
Authored: Mon Apr 6 13:05:38 2015 -0700
Committer: Dilli Dorai Arumugam <darumugam@hortonworks.com>
Committed: Tue Apr 7 12:45:25 2015 -0700

----------------------------------------------------------------------
 .../conf/ranger_webserver.properties              |  5 +++++
 .../ranger/server/tomcat/EmbeddedServer.java      | 18 +++++++++++++++---
 2 files changed, 20 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/63399d07/embeddedwebserver/conf/ranger_webserver.properties
----------------------------------------------------------------------
diff --git a/embeddedwebserver/conf/ranger_webserver.properties b/embeddedwebserver/conf/ranger_webserver.properties
index 2cc1e0d..ca98dee 100644
--- a/embeddedwebserver/conf/ranger_webserver.properties
+++ b/embeddedwebserver/conf/ranger_webserver.properties
@@ -21,6 +21,11 @@ http.service.port=6080
 service.shutdownPort=6085
 service.shutdownCommand=SHUTDOWN
 
+# Set ajp.enabled=true, if rnager-admin is behind an apache loadbalancer 
+# and loadbalacner is listening on https for requuests from clients
+# and  BalancerMember configuration in Apache is pointing to ajp protocol
+ajp.enabled=false
+
 #
 # SSL Connector Information
 # 

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/63399d07/embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java
----------------------------------------------------------------------
diff --git a/embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java
b/embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java
index 75653f8..b75dfe0 100644
--- a/embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java
+++ b/embeddedwebserver/src/main/java/org/apache/ranger/server/tomcat/EmbeddedServer.java
@@ -107,15 +107,27 @@ public class EmbeddedServer {
 		int sslPort = getIntConfig("https.service.port",-1) ;
 		int shutdownPort = getIntConfig("service.shutdownPort", DEFAULT_SHUTDOWN_PORT ) ;
 		String shutdownCommand = getConfig("service.shutdownCommand", DEFAULT_SHUTDOWN_COMMAND
) ;
-		
+
 		server.setHostname(hostName);
 		server.setPort(serverPort);
 		server.getServer().setPort(shutdownPort);
 		server.getServer().setShutdown(shutdownCommand);
 
 		boolean isHttpsEnabled = Boolean.valueOf(getConfig("https.attrib.SSLEnabled", "false"));
-		
-		if ((sslPort > 0) && isHttpsEnabled) {
+		boolean ajpEnabled = Boolean.valueOf(getConfig("ajp.enabled", "false"));
+
+		if (ajpEnabled) {
+
+			Connector ajpConnector = new Connector("org.apache.coyote.ajp.AjpNioProtocol");
+			ajpConnector.setPort(serverPort);
+			ajpConnector.setProperty("protocol", "AJP/1.3");
+
+			server.getService().addConnector(ajpConnector);
+
+			// Making this as a default connector
+			server.setConnector(ajpConnector);
+			LOG.info("Created AJP Connector");
+		} else if ((sslPort > 0) && isHttpsEnabled) {
 			Connector ssl = new Connector() ;
 			ssl.setPort(sslPort) ;
 			ssl.setSecure(true);


Mime
View raw message