2.2. Setup Virtual Hosting

[TOP]

If you want to set up multiple Web servers or LDAP repositories test environment with only one PC you should set up virtual host. By default this test suite will use three hostnames which names are 'ldap1', 'ldap2' and 'ldap3'. However you may add or remove the number of virtual hosts freely. It will depends on the test cases which you want to test.

NOTE: Multiple NICs(Network Interface Card) nor multiple PCs are not necessary.

2.2.1. /etc/hosts

For example, we assume that three static IP addresses which are '192.168.75.2', '192.168.75.3' and '192.168.75.4' are provided for the test suite and the original host name is 'host1'. You should modify '/etc/hosts' file like following.
192.168.75.2  host1 ldap1
192.168.75.3  ldap2
192.168.75.4  ldap3

2.2.2. /etc/sysconfig/netwokr-scripts/ifcfg-eth0:?

You already have 'ifcfg-eth0' like this.
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.75.2
NETMASK=255.255.255.0
NETWORK=192.168.75.0
BROADCAST=192.168.75.255
Add 'ifcfg-eth0:1' and 'ifcfg-eth0:2' as follows.
DEVICE=eth0:1
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.75.3
NETMASK=255.255.255.0
NETWORK=192.168.75.0
BROADCAST=192.168.75.255
DEVICE=eth0:2
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.75.4
NETMASK=255.255.255.0
NETWORK=192.168.75.0
BROADCAST=192.168.75.255
These are virtual hosts. Then you should execute 'ifup' command or reboot to make enable virtual hosts.
% ifup eth0:1
% ifup eth0:2

2.2.3. Checking virtual host

Check virtual hosts with 'ping' command.
% ping 192.168.75.2
% ping 192.168.75.3
% ping 192.168.75.4