Mod Proxy Balancer is only available in eApps hosting plans that are running the CentOS 5 or greater version of the operating system. To see what version you are running, login to your Control panel, click on My Account tab, then Subscriptions icon, then your Subscription. The Operating System version will be at the top.
This section will explain how to use Apache Mod Proxy in your eApps Hosting environment.
When we should use Apache Mod Proxy
Configuring Apache Mod Proxy
There are common situations when we want to expose only some specific parts of a non-Apache Web application (Ruby, Tomcat, Jboss, even another Apache server) to the outside world. With Apache Mod Proxy at reach we can do this quite easily through Apache. Of course, there are several ways to accomplish this, but in this document we will talk about how can this be done with Apache Mod Proxy, and we will also outline the benefits of using it.
Apache Mod Proxy is already available in the Apache installation on your VPS, so yo will not need to install anything else. However, there are no default directives added so once you have an application you want to expose through Apache Mod Proxy you will have to add some custom configuration directives to the Apache Web Server running in your VPS.
Let's consider a particular case of a Ruby application we want to make available through Apache Mod Proxy in the following environment:
the Ruby server is running on port 3000;
we want the application to be available at http://yourservername/my1stapp/.
In this example we will assume that the Ruby application is correctly configured and the Ruby server is running without issues on port 3000 on the same VPS. You will need to specify custom Apache configuration directives to tell the Apache server to feed the content from your Ruby application. The directives should be entered into the Custom Settings tab of the Website settings area on the Site tab of your control panel. In our example, we would navigate to the Custom Settings tab in the Control panel and enter the following directive:
ProxyPreserveHost on
ProxyPass /my1stapp/ http://localhost:3000/
This will make the content from localhost port 3000 available at http://yourwebsite/my1stapp/. Please note that the ProxyPreserveHost on directive has to be added only once per each web site configuration.
In this section we will understand the differences between the Mod Proxy configuration directives and the Mod Proxy Balancer configuration directives.
There are common situations when we want to expose the same applications as we talked before, but for performance and reliability reasons we run several instances of them, eventually on several application servers. The Apache Mod Proxy balancer sends keep-alives to the application servers it is configured to get the content from and figures out automatically and in a quite reasonable amount of time if one application server is down or stuck. Another benefit is that using multiple instances of the same application you can provide 100% uptime even when upgrading your applications (shutdown one instance, upgrade it, start it back, repeat the maintenance procedure for the second, third, ..., nth one).
In the following example we aim to provide the same functionality to our Web Server as we did for the my1stapp application in the configuration example above. Again, the directives need to be entered in the Custom Settings tab in the Website settings area on the Site tab for the site you want to configure.
ProxyPreserveHost on
<Proxy balancer://my1stapp>
BalancerMember http://localhost:3000/
</Proxy>
ProxyPass /my1stapp/ balancer://my1stapp/
In the above example we have configured a Mod Proxy Balancer having just one member, so this configuration provides exactly the same functionality as the previous example. At this point only the configuration directives differ and if we have only one balancer member it doesn't make much sense to use this configuration. But if we add another balancer member we can take advantage of the load balancing and fail-over capabilities of the Apache Mod Proxy Balancer module:
ProxyPreserveHost on
Using this configuration, the Apache Mod Proxy balancer will split the requests to http://yourwebsite/my1stapp/ between the first two balancer members based on their load factors (from 180 requests 100 will be sent to the first member and 80 to the second one). If both balancer member 1 and 2 become unavailable the requests will be sent to the 3rd member, which is configured as a hot stand-by member (the +H flag).
Please refer to http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html.
If you have any feedback for this document, please send it to support@eapps.com.
Configuration Information - For more details regarding other configuration parameters or for a more detailed description of each configuration parameter/directive for Apache Mod Proxy module you should visit http://httpd.apache.org/docs/2.2/mod/mod_proxy_balancer.html .