Apache Configuration

Load balancing uPortal behind Apache (HTTP Server) is a common and in-expensive way to host a single uPortal service across multiple servers.

Apache JServ Protocol (AJP)

Apache JServ Protocol is a binary protocol used to proxy inbound requests from a web server (e.g. Apache) to application servers. AJP is commonly used with Apache and Tomcat.

AJP does not directly support encryption between Apache and the Tomcat servers. This is usually okay when a secure subnet is used to protect traffic between servers.

Choosing A Plugin

Apache Web Server is a long-standing project with a large ecosystem of plugins. It is no surprise that there are multiple ways to configure Apache and Tomcat servers given this fact.

Mod_JK

The mod_jk plugin is fairly old. It is still functional and many experienced implementors are familiar with it. This is the main motivation to use this plugin over the mod_proxy_ajp. Another reason to select mod_jk is that it can expose SSL information to the Tomcats for detailed processing.

Load Balancing with Mod_JK

Mod_Proxy_AJP

The mod_proxy_ajp plugin is part of the modern mod_proxy* set of plugins. These have a consistent style of configuration. Implementors with mod_proxy experience will likely favor this plugin. The major concern with this module is it's relative age. There were buggy versions when it first appears around Apache 2.2.3. Sometimes packages are not kept current and these buggy versions may be deployed in your environment. It is suggested to avoid AJP and just use the mod_proxy_http module if mod_proxy* modules will be used.

Mod_Proxy_HTTP

 Mod_Proxy_HTTP load balances by directly passing HTTP packets on to the Tomcats. Optionally, HTTPS can be used to encrypt traffic. This approach closely resembles how Tomcats are configured to use hardware load balancers.

Load Balancing with Mod_Proxy_HTTP

Considerations

One consideration is whether to host Apache separately in it's own server or host it with a Tomcat (web container). Note that while the approach detailed below is specific to Apache and Tomcat, similar solutions for other containers should be easy to find. An advantage of having a Tomcat with Apache is that as long as the load balancing server is running correctly, it the service is available. Connection loss to other Tomcats, although performance will likely suffer. The downside is a potential that a flakey Tomcat on the load balancer may compromise the whole service if it brings down this critical server. The nice part of this decision is that configuring Tomcat local to Apache can be done the same as for remote Tomcats. They are  independent even with hosted on the same server.