|Red Hat Cluster Suite: Configuring and Managing a Cluster|
|Prev||Chapter 7. Setting Up Apache HTTP Server||Next|
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:
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:
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 </Directory>
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 member. Accordingly, when configuring the service, specify this script in the User Script field of the Service dialog box.
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.
Select the Services tab and click New. The Service properties dialog box is displayed.
Give the service a name (for example, httpd).
Choose httpd-domain from the Failover Domain list.
Specify a value in the Check Interval field.
Specify /etc/rc.d/init.d/httpd in the User Script field.
Select the httpd service on the Services tab and click Add Child. The Add Device or Service IP Address dialog box is displayed.
Choose Add Device and click OK. The Device properties dialog box is displayed.
Enter the device special file name in the Device Special File field (for example, /dev/hda7).
Enter the mount point in the Mount Point field (for example, /var/www/html/).
Choose ext3 from the FS Type list.
Enter rw in the Options field.
Ensure that Force Unmount is checked, and click OK.
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.
Choose Add Service IP Address and click OK. The Service IP Address properties dialog box is displayed.
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, 192.168.26.10).
Specify a netmask of None in the Netmask field.
In the Broadcast field, specify an IP address of None for broadcasting on the cluster subnet.
Choose File => Save to save your changes.
To start the Apache HTTP Server within the Cluster Status Tool, highlight the service and click Enable.