Show Table of Contents
A.3. Installing and Configuring the Apache HTTP Server
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
httpdRPM package. For example:
rpm -Uvh httpd-<version>.<arch>.rpm
To configure the Apache HTTP Server as a cluster service, perform the following tasks:
- Edit the
/etc/httpd/conf/httpd.confconfiguration 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:
Listen 192.168.1.100:80This 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:
<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/httpdis 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-domainwas 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
- Selectform the drop down menu.
- Enter ato 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 thefor the resource (for example,
- Choosefrom the drop-down menu.
- Enter the mount point in thefield (for example,
- Enter the device special file name in thefield (for example,
- Add an IP address for the Apache HTTP Server service.
- Choosefrom the drop-down menu.
- Enter theto be associated with the Apache HTTP Server service.
- Make sure that thecheckbox is left checked.
- Click theproperty.
- 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 thebutton. 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.