Load Balancing in Apache

Hi All,

I have one webserver which has an application for a set of internal users can be accessed by _http://server1.com

I am planning to load balance this application. For that I have cloned this server and build a new one which can be accessed using _http://server2.com]Server2.com. Also i have a virtual ip. So what I am planning is if the user type _http://virtualip.com then the application running on server 1 should be loaded for him. if the server1 is down, the application running on server2 should be loaded. How can I enable this using simple apache.

If the AppServer is on tomcat, you can refer the below link, which is explaining in depth on how to go with load balancing.
The Apache Tomcat Connector - Generic HowTo - LoadBalancer HowTo

If the AppServer is on Weblogic, a sample plugin module in httpd.conf shown below. Where it balances load between server1:7001 and server2:7002

# weblogic plugin -----------------------------
  <IfModule mod_weblogic.c>
    WebLogicCluster server1:7001,server2:7002
    WLIOTimeoutSecs 3600
    MatchExpression /gui/base/
    MatchExpression /gui/core/
    MatchExpression /gui/images/
    MatchExpression /gui/script/
  </IfModule>
  # end weblogic plugin -------------------------

With just a plain Apache, you can try starting an additional instance that uses mod_proxy_balance.

Another approach would be using Crossroads.

Or, if it's just fail-over you need, not load balancing, use Linux-HA to switch that between the hosts.