Before you install Sun Cluster HA for Apache, update the following information in the Apache configuration file httpd.conf.
The location of the httpd.conf file varies according to installation. System administrators typically install the httpd.conf file on the cluster file system. The default installation places the httpd.conf file in the /usr/local/apache/conf directory. When installing Apache packages bundled with Solaris, the file is located in the /etc/apache directory.
The ServerName directive that contains the hostname – For Sun Cluster HA for Apache to be highly available, you must set this directive to the name of the network address (logical hostname or shared address) that is used to access the server. You should have set up the logical hostname or shared address when you installed the cluster. See the Sun Cluster Concepts Guide for Solaris OS document for details on network resources.
The BindAddress directive, which you must set to the logical host or shared address – You can configure Apache to bind to INADDR_ANY. However, each resource must bind to a unique combination of network resource and port number. For example, if you run multiple resources, you can use INADDR_ANY provided that the port number for each resource is different.
The ServerType directive – This directive must be set to standalone, the default.
Multiple instances of Apache – If you have multiple instances of Apache, you must manage each instance with a separate resource. Furthermore, each separate resource must have a unique Bin_dir setting. Under the specified Bin_dir property that starts the particular instance of Apache, an apachect1 script must exist.
Different Apache resources can share the same httpd binary, that is, the apachect1 scripts for different resources can specify the path to the same httpd binary. However, you must modify each apachect1 script to use a different configuration file for specific Apache resources. To do so, use the -f option of the httpd command to specify a specific httpd.conf file.
The DocumentRoot directive that specifies the location of the documentation root directory – This directive is a pointer to a location on the cluster file system, where the HTML documents are installed.
The ScriptAlias directive that contains the location on a cluster file system of the cgi-bin directory – This directive is a pointer to a location on the cluster file system, where the cgi-bin files are installed.
You must follow certain conventions when you configure URL mappings for the web server. For example, when setting the CGI directory, locate the CGI directory on the cluster file system to preserve availability. For example, you might map your CGI directory to /global/diskgroup/ServerRoot/cgi-bin, where diskgroup is the disk device group that contains the Apache software. In situations where the CGI programs access “back-end” servers, such as an RDBMS, ensure that the Sun Cluster software controls the “back-end” server. If the server is an RDBMS that the Sun Cluster software supports, use one of the highly available RDBMS packages. Alternatively, you can use the APIs that the Sun Cluster Data Services Developer's Guide for Solaris OS documents to put the server under Sun Cluster control.
The lock file – If you use a lock file, set the value of the LockFile directive in your httpd.conf file to a local file.
The PidFile directive – Point this directive to a local file, as in the following example.
PidFile /usr/local/apache/log/httpd.pid |
While using Apache 2.0 with Sun Cluster HA for Apache, ensure that the directory to which the PidFile directive in the configuration file references exists and proper permissions are assigned. Before you install the Sun Cluster HA for Apache package, verify that the Apache software is properly installed and configured to run on a cluster.
In Apache 1.x, the PidFile directive points to /var/run/httpd.pid, which is created by default when Solaris is installed. But, in Apache 2.0, the PidFile directive has been modified to point to /var/run/apache2/httpd.pid. Since this directory does not exist by default, you are required to create it manually, else the resource will not start.
The Port directive setting that the server port or ports access – The defaults are set in each node's httpd.conf file. The Port_list resource property must include all of the ports that the httpd.conf files specify.
The Port_list property assumes that the web server serves all combinations of ports and IP addresses from the network resources as defined in the Network_resources_used property.
Port_list=”80/tcp,443/tcp,8080/tcp” |
The preceding Port_list configuration, for example, probes the following IP-port combinations.
Host |
Port |
Protocol |
node1 |
80 |
tcp |
node1 |
443 |
tcp |
node1 |
8080 |
tcp |
node2 |
80 |
tcp |
node2 |
443 |
tcp |
node2 |
8080 |
tcp |
However, if node1 serves ports 80 and 443 only and node2 serves ports 80 and 8080 only, you can configure the Port_list property for Apache as follows.
Port_list=node1/80/tcp,node1/443/tcp,node2/80/tcp,node2/8080/tcp |
Consider the following rules.
You must specify hostnames or IP addresses (not network resource names) for node1 and node2.
If Apache serves nodeN/port for every nodeN in the Network_resources_used property, you can use a short form to replace the combination of, for example, node1/port1, node2/port2, and so on. See the following examples.
Example One
Port_list=”80/tcp,node1/443/tcp,node2/8080/tcp” Network_resources_used=node1,node2 |
This example probes the following IP-port combinations.
Host |
Port |
Protocol |
node1 |
80 |
tcp |
node1 |
443 |
tcp |
node2 |
80 |
tcp |
node2 |
8080 |
tcp |
Example Two
Port_list=”node1/80/tcp,node2/80/tcp” Network_resources_used=net-1,net-2 #net-1 contains node1. #net-2 contains node2 and node3. |
This example probes the following IP-port combinations.
Host |
Port |
Protocol |
node1 |
80 |
tcp |
node2 |
80 |
tcp |
All of the hostnames (IP addresses) that the Port_list property specifies must not belong to a network resource that is specified in any other scalable resource's Network_resources_used property. Otherwise, as soon as a scalable service detects that another scalable resource already uses an IP address, creation of the Apache resource fails.
The Apache resource can use an already created shared address resource provided they listen to a port or port list that is not being used on that shared address.
If you run Sun Cluster HA for Apache and another HTTP server, configure the HTTP servers to listen on different ports. Otherwise, a port conflict can occur between the two servers.
To register and configure Sun Cluster HA for Apache, you must consider or provide information on the following points.
Decide whether to run Sun Cluster HA for Apache as a failover or scalable data service.
Decide whether to install a secure or non secure version of the Apache webserver.
Decide which fault monitoring resource properties to set. In most cases, the default values suffice. See Sun Cluster Data Services Planning and Administration Guide for Solaris OS for information about the standard properties and Appendix A, Sun Cluster HA for Apache Extension Properties for information about the extension properties.
Provide the name of the resource type for Sun Cluster HA for Apache. This name is SUNW.apache.
Provide the names of the cluster nodes that will master the data service.
Provide the logical hostname (failover services) or shared address (scalable services) that clients use to access the data service. You typically set up this IP address when you install the cluster. See the Sun Cluster Concepts Guide for Solaris OS document for details on network resources.
Provide the path to the application binaries. You can install the binaries on the local disks or on the cluster file system. See Configuration Guidelines for Sun Cluster Data Services in Sun Cluster Data Services Planning and Administration Guide for Solaris OS for a discussion of the advantages and disadvantages of each location.
Modify each copy of apachect1 to use the appropriate httpd.conf configuration file.
Exercise caution when you change the Load_balancing_weights property for an online scalable service that has the Load_balancing_policy property set to LB_STICKY or LB_STICKY_WILD. Changing these properties while the service is online can cause existing client affinities to be reset, hence a different node might service a subsequent client request even if another cluster member previously serviced the client.
Similarly, when a new instance of the service is started on a cluster, existing client affinities might be reset.
Determine the entry for the Port_list property. The Port_list property can have multiple entries. See How to Register and Configure Sun Cluster HA for Apache by Using Sun Cluster Command Line Interface (CLI) for details.
Determine whether to utilize the Monitor_Uri_List extension property. This extension property enables you to monitor an arbitrary list of URIs. Arbitrary monitoring of URIs is beneficial if you require the Sun Cluster HA for Apache agent probe to monitor any applications (URIs) deployed on the Sun Cluster HA for Apache server. Use of the Monitor_Uri_List extension property is not supported with secure instances of Sun Cluster HA for Apache. You must install release 3.1 10/03 or 3.2 of Sun Cluster HA for Apache to use this property. If you are upgrading Sun Cluster HA for Apache from a previous version, you must perform a resource type upgrade procedure to use the new property. For instructions, see Upgrading a Resource Type in Sun Cluster Data Services Planning and Administration Guide for Solaris OS. See Monitoring Arbitrary URIs for detailed information about using the Monitor_Uri_List extension property.