Before you install HA for Apache, update the following information in the Apache configuration file httpd.conf.
The ServerName directive that contains the hostname – For 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 Oracle Solaris Cluster 4.3 Concepts Guide 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 apachectl script must exist.
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.
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 /local/apache/log/httpd.pid
In Apache 2.2, the PidFile directive can be modified to point to /local/apache/log/httpd.pid. Since this directory does not exist by default, you are required to create it manually or 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 resource_dependencies property.
Port_list=”80/tcp,443/tcp,8080/tcp”
The preceding Port_list configuration, for example, probes the following IP-port combinations.
|
However, if phys-schost-1 serves ports 80 and 443 only and phys-schost-2 serves ports 80 and 8080 only, you can configure the Port_list property for Apache as follows:
Port_list=phys-schost-1/80/tcp,phys-schost-1/443/tcp, phys-schost-2/80/tcp,phys-schost-2/8080/tcp
Consider the following rules.
You must specify hostnames or IP addresses (not network resource names) for phys-schost-1 and phys-schost-2.
If Apache serves phys-schost-N/port for every phys-schost-N in the resource_dependencies property, you can use a short form to replace the combination of, for example, phys-schost-1/port1, phys-schost-2/port2, and so on. See the following examples.
Example One
Port_list=”80/tcp,phys-schost-1/443/tcp,phys-schost-2/8080/tcp” resource_dependencies=phys-schost-1,phys-schost-2
This example probes the following IP-port combinations.
|
Example Two
Port_list=”phys-schost-1/80/tcp,phys-schost-2/80/tcp” resource_dependencies=net-1,net-2 #net-1 contains phys-schost-1. #net-2 contains phys-schost-2 and phys-schost-3.
This example probes the following IP-port combinations.
|
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 Resource_dependencies property. Otherwise, as soon as a scalable service detects that another scalable resource already uses an IP address, creation of the Apache resource fails.
Apache Proxy Server – Add the following lines of code to the httpd.conf file if you choose to configure the Apache software as a proxy server.
# Proxy Server Directives. <IfModule mod_proxy.c> ProxyRequests On <Directory proxy:*> Order deny,allow Deny from all Allow from IP_ADDRESS </Directory> ProxyVia On </IfModule> # End of Proxy Server Directives.
You can add the following lines to the httpd.conf to configure Apache HTTPS. This is a simple configuration for illustration purposes. Refer to Apache documentation for all details.
... LoadModule ssl_module modules/mod_ssl.so Listen 443 <VirtualHost logical-host:443> ServerName logical-host.example.com SSLEngine on SSLCertificateFile /global/apache/conf/ssl/server.crt SSLCertificateKeyFile /global/apache/conf/ssl/server.key </VirtualHost> ...
To register and configure HA for Apache, you must consider or provide information on the following points.
Decide whether to run HA for Apache as a failover or scalable data service.
Decide which fault monitoring resource properties to set. In most cases, the default values suffice. See the Oracle Solaris Cluster 4.3 Data Services Planning and Administration Guide for information about the standard properties and Appendix A, HA for Apache Extension Properties for information about the extension properties.
Provide the name of the resource type for 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 Oracle Solaris Cluster 4.3 Concepts Guide 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 Oracle Solaris Cluster Data Services in Oracle Solaris Cluster 4.3 Data Services Planning and Administration Guide for a discussion of the advantages and disadvantages of each location.
Modify each copy of apachectl 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 HA for Apache Using Oracle Solaris 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 HA for Apache agent probe to monitor any applications (URIs) deployed on the HA for Apache server. Use of the Monitor_Uri_List extension property is not supported with HTTP instances of HA for Apache. See Monitoring Arbitrary URIs for detailed information about using the Monitor_Uri_List extension property.