Prior to installation of Sun Cluster HA for Apache, update the following information in the Apache configuration file, httpd.conf:
The ServerName directive that contains the host name. For Sun Cluster HA for Apache to be highly available, you must set this directive to the name of the network address (logical host name or shared address) that is used to access the server. The logical host name or shared address should have been set up when the cluster was installed; if not, refer to the Sun Cluster 3.0 Installation Guide for information on how to set up logical host names and shared addresses and set one up now.
The BindAddress directive, which you must set to the logical host or shared address. Since you can configure Apache to bind to INADDR_ANY, if you plan on running multiple instances of the Apache data service or multiple data services on the same node, each instance must bind to a unique network resource and port number.
The ServerType directive, which must be set to standalone, the default.
The ServerRoot directive that specifies the top of the directory tree under which the server's conf and log subdirectories are typically located. This directive has no default.
If you use a cluster file system as the location for the server root, you need only install the Apache software on that single file system to make it accessible to all the nodes that can run the data service. See the discussion on placement of the binary files in "Determining the Location of the Application Binaries".
You might have multiple instances that use a single Apache binary. The location of the configuration file is specified according to the Confdir_list resource property. For example:
(Location of the Apache binaries - also the value of the Bin_dir property) /global/apache/bin (Location of configuration directories - Confdir_list property) /global/websites/dev/conf /global/websites/sqa/conf (Location of httpd.conf files) /global/websites/dev/conf/httpd.conf /global/websites/sqa/conf/httpd.conf |
To start up the instances by hand, as you might if you are verifying your setup, use the following commands. Also, when instructed by the Resource Group Manager (RGM), the data service in effect issues the following commands to start up the instances:
# /global/apache/bin/httpd \ -f /global/websites/dev/conf/httpd.conf # /global/apache/bin/httpd \ -f /global/websites/sqa/conf/httpd.conf |
The DocumentRoot directive that specifies the location of the documentation root directory. This 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 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, preserve availability by locating the CGI directory on the cluster file system. For example, you might map your CGI directory to /global/disk-device-group/ServerRoot/cgi-bin, where disk-device-group 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 "back-end" server is also controlled by Sun Cluster. If the server is an RDBMS supported by Sun Cluster, use one of the highly available RDBMS packages. Alternatively, you can put the server under Sun Cluster control by using the APIs documented in the Sun Cluster 3.0 Data Services Developers' Guide.
If you are using a lock file, set the value of the LockFile directive in your httpd.conf file to a local file.
Use a PidFile directive to point to a local file. For example:
PidFile /usr/local/apache/log/httpd.pid |
The Port directive setting accessed by the server port or ports. The defaults are set in each node's httpd.conf file. The Port_list resource property must include all the ports specified in the httpd.conf files.
Port_list assumes that the Web server serves all combinations of ports and IP addresses from the network resources as defined in Network_resources_used. For example:
Port_list="80/tcp,443/tcp,8080/tcp" |
probes the following IP-port combinations:
Host |
Port | Protocol |
host-1 |
80 |
tcp |
host-1 |
443 |
tcp |
host-2 |
8080 |
tcp |
host-2 |
80 |
tcp |
host-2 |
443 |
tcp |
host-2 |
8080 |
tcp |
However, if host-1 serves 80 and 443 only and host-2 serves ports 80 and 8080 only, you can configure Port_list for Apache as follows:
Port_list=host-1/80/tcp,host-1/443/tcp,host-2/80/tcp,host-2/8080/tcp |
Bear in mind the following rules:
You must specify host names or IP addresses (not network resource names) for host-1 and host-2.
If Apache serves host-n/port for every host-n in Network_resources_used, you can use a short form to replace the combination of host-1/port-1, host-2/port-2, and so on. See the following examples.
Example One:
Port_list="80/tcp,host-1/443/tcp,host-2/8080/tcp" Network_resources_used=host-1,host-2 |
probes the following IP-port combinations:
Host |
Port | Protocol |
host-1 |
80 |
tcp |
host-1 |
443 |
tcp |
host-2 |
80 |
tcp |
host-2 |
8080 |
tcp |
Example Two:
Port_list="host-1/80/tcp,host-2/80/tcp" Network_resources_used=net-1,net-2 #net-1 contains host-1. #net-2 contains host-2 and host-3. |
probes the following IP-port combinations:
Host |
Port | Protocol |
host-1 |
80 |
tcp |
host-2 |
80 |
tcp |
All host names (IP addresses) that are specified in Port_list 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 an IP address is already in use by another scalable resource, creation of the Apache resource fails.
If you are running the Sun Cluster HA for Apache data service 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:
Decide whether to run Sun Cluster HA for Apache as a failover or a scalable service.
Decide which fault monitoring resource properties (such as Thorough_probe_interval or Probe_timeout) to set. In most cases, the default values suffice. For information on these properties, refer to "Configuring Sun Cluster HA for Apache 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 host name (failover services) or shared address (scalable services) to be used by clients to access the data service. This IP address is normally set up when the cluster is installed. For details on how to set up network addresses, see the Sun Cluster 3.0 Installation Guide.
Provide the path to the application binaries. You can install the binaries on the local disks or on the cluster file system. For a discussion of the advantages and disadvantages of each location, see "Determining the Location of the Application Binaries".
Provide the path to the conf directory.
Exercise caution when changing Load_balancing_weights for an online scalable service that has Load_balancing_policy set to LB_STICKY or LB_STICKY_WILD. Changing those 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 the client had been previously serviced by another node in the cluster.
Similarly, when a new instance of the service is started on a cluster, existing client affinities might be reset.
If a scalable proxy is serving a scalable Web resource with the LB_STICKY policy, you must also set up an LB_STICKY policy for the proxy.
Determine the entries for the Confdir_list and Port_list properties. For failover services, Confdir_list can have only one entry; Port_list can have multiple entries. For scalable services, both properties can have multiple entries. For details, see "How to Register and Configure Sun Cluster HA for Apache".