Installation guide
Example of Setting Up Apache HTTP Server
This appendix provides an example of setting up a highly available Apache HT T P Server on a Red Hat
Cluster. T he example describes how to set up a service to fail over an Apache HT T P Server. Variables
in the example apply to this example only; they are provided to assist setting up a service that suits your
requirements.
Note
This example uses the Cluster Configuration Tool (system -config-cluster). You can
use comparable Conga functions to make an Apache HTTP Server highly available on a Red Hat
Cluster.
A.1. Apache HTTP Server Setup Overview
First, configure Apache HT T P Server on all nodes in the cluster. If using a failover domain , assign the
service to all cluster nodes configured to run the Apache HTTP Server. Refer to Section 5.6,
“Configuring a Failover Domain” for instructions. T he cluster software ensures that only one cluster
system runs the Apache HT T P Server at one time. T he example configuration consists of installing the
httpd RPM package on all cluster nodes (or on nodes in the failover domain, if used) and configuring a
shared GFS shared resource for the Web content.
When installing the Apache HTTP Server on the cluster systems, run the following command to ensure
that the cluster nodes do not automatically start the service when the system boots:
# chkconfig --del httpd
Rather than having the system init scripts spawn the httpd daemon, the cluster infrastructure initializes
the service on the active cluster node. T his ensures that the corresponding IP address and file system
mounts are active on only one cluster node at a time.
When adding an httpd service, a floating IP address must be assigned to the service so that the IP
address will transfer from one cluster node to another in the event of failover or service relocation. The
cluster infrastructure binds this IP address to the network interface on the cluster system that is
currently running the Apache HTT P Server. T his IP address ensures that the cluster node running
httpd is transparent to the clients accessing the service.
The file systems that contain the Web content cannot be automatically mounted on the shared storage
resource when the cluster nodes boot. Instead, the cluster software must mount and unmount the file
system as the httpd service is started and stopped. T his prevents the cluster systems from accessing
the same data simultaneously, which may result in data corruption. T herefore, do not include the file
systems in the /etc/fstab file.
A.2. Configuring Shared Storage
To set up the shared file system resource, perform the following tasks as root on one cluster system:
1. On one cluster node, use the interactive parted utility to create a partition to use for the
document root directory. Note that it is possible to create multiple document root directories on
different disk partitions.
2. Use the mkfs command to create an ext3 file system on the partition you created in the previous
Example of Setting Up Apache HTTP Server
81