If the server doesn’t already have Apache installed, install it:
# apt-get install apache2
If you haven’t installed the content files for your web site, you can do it now or after load balancing is set up.
Install iproute (a Linux networking package with more features than older utilities such as ifconfig and route):
# apt-get install iproute
Add these lines to /etc/sysctl.conf:
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.eth0.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.eth0.arp_announce = 2
Get the changes into the kernel:
# sysctl -p
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.eth0.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.eth0.arp_announce = 2
Assuming that your realserver is a Debian system, edit the /etc/network/interfaces file, associating the VIP (70.253.15.42) with the loopback aliaslo:0:
auto lo:0
iface lo:0 inet static
address 70.253.15.42
netmask 255.255.255.255
pre-up sysctl -p > /dev/null
Enable the loopback alias:
# ifup lo:0
Create the file /var/www/ldirector.html with the contents:
I'm alive!
On web1:
# echo "I'm web1" > /var/www/which.html
On web2:
# echo "I'm web2" > /var/www/which.html
Start Apache, or restart it if it’s already running:
# /etc/init.d/apache2 restart
Please check back next week for the conclusion to this article.