HowTo Loadbalance Apache Servers on Linux CentOS 5.3

Author : j0zf 2009.7.16

please note: this howto is a work-in-progress, if you have questions you can jump on IRC Freenode.net in channel #ApogeeINVENT and ask :-)

Basic 3-Layer Server Setup

Layer 1 : loadbalancer.yoursite.com  ( aka www.yoursite.com )

Layer 1 is the main entry point of all web requests.  This is the server where we'll also setup our named nameserver to provide the dns resolution for all our servers in this cluster.

Layer 2 : www1.yoursite.com, www2.yoursite.com, ..., wwwN.yoursite.com

All your web requests are served by this layer.  With this example we will be using sticky-sessions, so each successive webrequest that comes in will go to the same server based upon a cookie which will identify what server to use.  Rsync will be used to keep the webserver files synchronized.

Layer 3 : dbserver.yoursite.com  ( MySQL database server or cluster )

The firewall can be configured on this server to block all traffic from the outside world (aside from our webserver layer) leaving it less vulnerable to attacks and one step closer to obtaining PCI-Compliance.  Here's a PCI-Compliant Checklist.

Note : There are 2 single points of failure inherent to this setup (at the loadbalancer layer and the mysql layer) which we'll have to deal with at a later time in a different howto.

This howto is very much incomplete, I'll be adding to it as I have the time available.

My Notes :

Joseph Frazier | Create Your Badge

This page has been visited 3,196 times since July 16th, 2009

This is an ApogeeInvent Dynamic Website