The Apache HTTP Server must be installed and configured on all nodes in the assigned failover domain, if used, or in the cluster. The basic server configuration must be the same on all nodes on which it runs for the service to fail over correctly. The following example shows a basic Apache HTTP Server installation that includes no third-party modules or performance tuning.
On all node in the cluster (or nodes in the failover domain, if used), install the
httpd RPM package. For example:
rpm -Uvh httpd-<version>.<arch>.rpm
To configure the Apache HTTP Server as a cluster service, perform the following tasks:
/etc/httpd/conf/httpd.conf configuration file and customize the file according to your configuration. For example:
Specify the directory that contains the HTML files. Also specify this mount point when adding the service to the cluster configuration. It is only required to change this field if the mount point for the web site's content differs from the default setting of
/var/www/html/. For example:
Specify a unique IP address to which the service will listen for requests. For example:
This IP address then must be configured as a cluster resource for the service using the Cluster Configuration Tool.
If the script directory resides in a non-standard location, specify the directory that contains the CGI programs. For example:
ScriptAlias /cgi-bin/ "/mnt/httpdservice/cgi-bin/"
Specify the path that was used in the previous step, and set the access permissions to default to that directory. For example:
Allow from all
Additional changes may need to be made to tune the Apache HTTP Server or add module functionality. For information on setting up other options, refer to the Red Hat Enterprise Linux System Administration Guide and the Red Hat Enterprise Linux Reference Guide.
The standard Apache HTTP Server start script,
/etc/rc.d/init.d/httpd is also used within the cluster framework to start and stop the Apache HTTP Server on the active cluster node. Accordingly, when configuring the service, specify this script by adding it as a resource in the Cluster Configuration Tool.
Copy the configuration file over to the other nodes of the cluster (or nodes of the failover domain, if configured).
Before the service is added to the cluster configuration, ensure that the Apache HTTP Server directories are not mounted. Then, on one node, invoke the Cluster Configuration Tool to add the service, as follows. This example assumes a failover domain named
httpd-domain was created for this service.
Add the init script for the Apache HTTP Server service.
Select the Resources Configuration properties dialog box is displayed.
tab and click . The
Select form the drop down menu.
Enter a to be associated with the Apache HTTP Server service.
Specify the path to the Apache HTTP Server init script (for example,
/etc/rc.d/init.d/httpd) in the field.
Add a device for the Apache HTTP Server content files and/or custom scripts.
In the Resource Configuration dialog, select from the drop-down menu.
Enter the for the resource (for example,
Choose from the drop-down menu.
Enter the mount point in the field (for example,
Enter the device special file name in the field (for example,
Add an IP address for the Apache HTTP Server service.
Choose from the drop-down menu.
Enter the to be associated with the Apache HTTP Server service.
Make sure that the checkbox is left checked.
Click the property.
Create the Apache HTTP Server service.
Click Add a Service dialog.
. Type a for the service in the
In the Service Management dialog, select a from the drop-down menu or leave it as .
Click the button. From the available list, choose each resource that you created in the previous steps. Repeat this step until all resources have been added.
Choose => to save your changes.