7.3. Installing and Configuring the Apache HTTP Server

The Apache HTTP Server must be installed and configured on all members in the assigned failover domain, if used, or in the cluster. The basic server configuration must be the same on all members 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 member systems in the cluster (or members in the failover domain, if used), install the httpd RPM package. For example:

rpm -Uvh httpd-<version>.<arch>.rpm

On one system, perform the following tasks:

  1. Edit the /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 mountpoint for the website's content differs from the default setting of /var/www/html/. For example:

      DocumentRoot "/mnt/httpdservice/html"
    • 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:

      <Directory /mnt/httpdservice/cgi-bin">
      AllowOverride None
      Options None 
      Order allow,deny 
      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.

  2. 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 member. Accordingly, when configuring the service, specify this script in the User Script field of the Service dialog box.

  3. Copy the configuration file over to the other members of the cluster (or members 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 member, 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. Figure 7-1 shows the <device> settings for configuring the shared storage and mount point where HTML files and CGI scripts will be stored.

Figure 7-1. Configuring Apache HTTP Server

  1. Select the Services tab and click New. The Service properties dialog box is displayed.

    1. Give the service a name (for example, httpd).

    2. Choose httpd-domain from the Failover Domain list.

    3. Specify a value in the Check Interval field.

    4. Specify /etc/rc.d/init.d/httpd in the User Script field.

    5. Click OK.

  2. Select the httpd service on the Services tab and click Add Child. The Add Device or Service IP Address dialog box is displayed.

    1. Choose Add Device and click OK. The Device properties dialog box is displayed.

    2. Enter the device special file name in the Device Special File field (for example, /dev/hda7).

    3. Enter the mount point in the Mount Point field (for example, /var/www/html/).

    4. Choose ext3 from the FS Type list.

    5. Enter rw in the Options field.

    6. Ensure that Force Unmount is checked, and click OK.

  3. Ensure that the httpd service is still selected in the Services tab and click Add Child. The Add Device or Service IP Address dialog box is displayed.

    1. Choose Add Service IP Address and click OK. The Service IP Address properties dialog box is displayed.

    2. In the IP Address field, specify an IP address, which the cluster infrastructure binds to the network interface on the cluster system that runs the httpd service (for example,

    3. Specify a netmask of None in the Netmask field.

    4. In the Broadcast field, specify an IP address of None for broadcasting on the cluster subnet.

    5. Click OK.

  4. Choose File => Save to save your changes.

  5. To start the Apache HTTP Server within the Cluster Status Tool, highlight the service and click Enable.