Sun Cluster 2.2 7/00 Data Services Update: Apache Web Server Sun Microsystems, Inc. 901 San Antonio Road Palo Alto, CA 94303-4900 U.S.A. 650-960-1300 Part No. 806-6121 July 2000, Revision A
Copyright 2000 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, California 94303-4900 U.S.A. All rights reserved. This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers. Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd. For Netscape Communicator, the following notice applies: (c) Copyright 1995 Netscape Communications Corporation. All rights reserved. Sun, Sun Microsystems, the Sun logo, AnswerBook2, docs.sun.com, and Solaris are trademarks, registered trademarks, or service marks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. The OPEN LOOK and Sun Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun s licensees who implement OPEN LOOK GUIs and otherwise comply with Sun s written license agreements. Federal Acquisitions: Commercial Software-Government Users Subject to Standard License Terms and Conditions. DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID. Copyright 2000 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, Californie 94303 Etats-Unis. Tous droits réservés. Ce produit ou document est protégé par un copyright et distribué avec des licences qui en restreignent l utilisation, la copie, la distribution, et la décompilation. Aucune partie de ce produit ou document ne peut être reproduite sous aucune forme, par quelque moyen que ce soit, sans l autorisation préalable et écrite de Sun et de ses bailleurs de licence, s il y en a. Le logiciel détenu par des tiers, et qui comprend la technologie relative aux polices de caractères, est protégé par un copyright et licencié par des fournisseurs de Sun. Des parties de ce produit pourront être dérivées des systèmes Berkeley BSD licenciés par l Université de Californie. UNIX est une marque déposée aux Etats-Unis et dans d autres pays et licenciée exclusivement par X/Open Company, Ltd. La notice suivante est applicable à Netscape Communicator : (c) Copyright 1995 Netscape Communications Corporation. Tous droits réservés. Sun, Sun Microsystems, le logo Sun, AnswerBook2, docs.sun.com, et Solaris sont des marques de fabrique ou des marques déposées, ou marques de service, de Sun Microsystems, Inc. aux Etats-Unis et dans d autres pays. Toutes les marques SPARC sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d autres pays. Les produits portant les marques SPARC sont basés sur une architecture développée par Sun Microsystems, Inc. L interface d utilisation graphique OPEN LOOK et Sun a été développée par Sun Microsystems, Inc. pour ses utilisateurs et licenciés. Sun reconnaît les efforts de pionniers de Xerox pour la recherche et le développement du concept des interfaces d utilisation visuelle ou graphique pour l industrie de l informatique. Sun détient une licence non exclusive de Xerox sur l interface d utilisation graphique Xerox, cette licence couvrant également les licenciés de Sun qui mettent en place l interface d utilisation graphique OPEN LOOK et qui en outre se conforment aux licences écrites de Sun. CETTE PUBLICATION EST FOURNIE "EN L ETAT" ET AUCUNE GARANTIE, EXPRESSE OU IMPLICITE, N EST ACCORDEE, Y COMPRIS DES GARANTIES CONCERNANT LA VALEUR MARCHANDE, L APTITUDE DE LA PUBLICATION A REPONDRE A UNE UTILISATION PARTICULIERE, OU LE FAIT QU ELLE NE SOIT PAS CONTREFAISANTE DE PRODUIT DE TIERS. CE DENI DE GARANTIE NE S APPLIQUERAIT PAS, DANS LA MESURE OU IL SERAIT TENU JURIDIQUEMENT NUL ET NON AVENU. Please Recycle
CHAPTER 1 Sun Cluster 2.2 7/00 Data Services Update: Apache Web Server Sun Cluster High Availability (HA) for Apache is an Apache Web Server that runs under the control of Sun Cluster. This document describes how to install the Apache Web Server so that it runs as the Sun Cluster HA for Apache Web Server data service. 1
Preparing for Installation The Apache Web Server requires some variations from the default installation parameters. In particular: You must specify the logical host name, not the physical host name. Your binary files can reside on the local host, in which case you may not have to take down the logical host for upgrades; however, the docs directory must reside on the multihost disk. Alternatively, you can place all the files, including the binaries, on the multihost disk. In the latter case, when prompted, do not use the default server root disk. The procedures described in this document assume that you are installing the binaries on the multihost disk. You must follow certain conventions when you configure URL mappings for the Web server. For example, to preserve availability while setting the CGI directory, you must locate the mapped directories on the multihost disks associated with the logical host that serves Apache Web Server requests for this mapping. In this case, you map your CGI directory to /logicalhost/commerce/apache-home/cgi-bin. In situations where the CGI programs access back-end data, verify that the data are also located on the multihost disks associated with the logical host that serves the Apache Web Server requests. 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, such as Sun Cluster HA for Oracle, Sun Cluster HA for Sybase, or Sun Cluster HA for Informix. Otherwise, you can use the APIs that are documented in the Sun Cluster 2.2 API Developer s Guide to put the server under Sun Cluster control. 2 Sun Cluster 2.2 7/00 Data Services Update: Apache Web Server July 2000
Installing the Apache Web Server Software For standard Apache installation instructions and details on the Apache Web Server software, see the Apache Web site at: http://www.apache.org How to Download, Uncompress, and Untar the Binaries Sun Cluster 2.2 supports Apache Web Server version 1.3.9 for the Solaris 8 operating environment. You can download this version from the Apache Web site at http://www.apache.org either as a binary distribution or as source files. If you choose the source files, you can compile them on the local machine. We recommend the binary distribution. Do the following: 1. Make a directory for the Apache installation script: % mkdir script-dir 2. Go to the Apache Web site: http://www.apache.org and download the binary distribution. Save the file in script-dir. Typically, the downloaded file is in compressed gzip and tarred format named filename.gz.tar. 3. Uncompress the binaries by typing: % gzip -d filename.gz.tar 4. Untar the resulting file by typing: % tar -xvf filename.tar The directory then contains the installation scripts. Chapter 1 Sun Cluster 2.2 7/00 Data Services Update: Apache Web Server 3
How to Install the Apache Web Server 1. Run the install-bindist.sh script and supply the name of the directory on the multihost disk on which the server is to be installed, as follows: phys-hahost1#./install-bindist.sh install-dir The install-dir directory is the multihost disk on which the binary distribution is to be installed. If you do not specify install-dir, Apache uses /usr/local/apache as the destination directory, which resides on the local disk only. The following is then displayed: install-bindist.sh install-dir Installing binary distribution for platform sun4u-sun-solaris2.80 into directory install-dir Ready. You now have successfully installed the Apache 1.3.9 HTTP server. To verify that Apache actually works correctly you should first check the (initially created or preserved) configuration files: install-dir/conf/httpd.conf You should then be able to immediately fire up Apache the first time by running: install-dir/bin/apachectl start Thanks for using Apache. The Apache Group http://www.apache.org/ 2. Edit the install-dir/conf/httpd.conf file, as follows: a. Redefine the property of ServerName to be the logical host name (rather than the physical host name). This step is necessary for Sun Cluster HA for Apache to fail over correctly. b. Set the property port to the port on which the Apache Web Server listens. The default and most commonly used port number for Apache is 80. 3. (Optional) Further customize install-dir/conf/httpd.conf as required. 4 Sun Cluster 2.2 7/00 Data Services Update: Apache Web Server July 2000
Installing and Configuring Sun Cluster HA for Apache Prior to configuring Sun Cluster HA for Apache, you must install and set up the Sun Cluster and Apache products. You configure Sun Cluster HA for Apache by using the hadsconfig(1m) command. See the man page for details. How to Install and Configure Sun Cluster HA for Apache 1. On all nodes, install the Sun Cluster patch that enhances the scinstall(1m) command to recognize Sun Cluster HA for Apache. The patch is available from your service provider or from the Sun patch Web site http://sunsolve.sun.com. 2. On each Sun Cluster node that is a potential master of the logical host on which Apache is installed, run the scinstall(1m) command to install the Sun Cluster HA for Apache package, SUNWscapc, and supporting packages in the default location. 3. On all nodes, install the Sun Cluster patch that enhances the hadsconfig(1m) command to recognize Sun Cluster HA for Apache. 4. On one node only, run the hadsconfig(1m) command to create, edit, or delete instances of the Sun Cluster HA for Apache, as follows: phys-hahost1# hadsconfig For information on input to supply to hadsconfig(1m), see Understanding the Configuration Parameters on page 5. 5. If the service is not yet registered, run the hareg(1m) command on one node only to register the Sun Cluster HA for Apache data service. To register the service on the logical host only, include the -h option and logical host name, as follows: phys-hahost1# hareg -s -r apache -h logicalhost Chapter 1 Sun Cluster 2.2 7/00 Data Services Update: Apache Web Server 5
6. On one node only, run the hareg(1m) command to enable Sun Cluster HA for Apache and perform a cluster reconfiguration, as follows: phys-hahost1# hareg -y apache 7. Confirm your Apache Web Server operation by establishing a telnet connection to your logical host, where the service is listening. For example: # telnet logicalhost port-number 6 Sun Cluster 2.2 7/00 Data Services Update: Apache Web Server July 2000
Understanding the Configuration Parameters This section describes the information you supply to the hadsconfig(1m) command to create configuration files for Sun Cluster HA for the Apache data service. The hadsconfig command uses templates to create these configuration files. The templates contain defaults; some are hard coded and others are unspecified parameters. You must provide values for the unspecified parameters. The fault probe parameters, in particular, can affect the performance of Sun Cluster HA for Apache data services. Tuning the probe interval value too low (that is, increasing the frequency of fault probes) might encumber system performance and result in unnecessary takeovers or attempted restarts when the system is simply slow. Fault monitor parameters are configurable for Sun Cluster HA for the Apache Web Server. One of the parameters is the takeover flag, which specifies how Sun Cluster handles partial failover. You have two options: y (yes) Sun Cluster attempts to switch over the logical host to another master. However, if the attempt fails, the logical host remains on the original master. This is the default setting. n (no) Sun Cluster does not move the logical host to another master even if it detects problems with the data server, nor does it take any action against the faulty data server or database on the logical host. Configure the Sun Cluster HA for Apache Web Server parameters listed in the hadsconfig(1m) input form by supplying the options described in TABLE 1-1. The parameters are listed in the order they appear in the form. TABLE 1-1 Parameter Configuration Parameters for Sun Cluster HA for Apache Description NAME (name of the instance) LOGICAL_HOST (logical host) PORT (server port number) The name tag that serves as an identifier for the instance. The log messages generated by Sun Cluster refer to this name tag. The hadsconfig(1m) command prefixes the package name to the value you supply here. For example, if you specify apache_80, hadsconfig produces SUNWscapc_apache_80. The name of the logical host that provides service for this instance of Sun Cluster HA for Apache Web Server. The unique port for this instance of Sun Cluster HA for Apache Web Server. This is the server port value you supplied to the httpd.conf file while configuring Apache Web Server. Chapter 1 Sun Cluster 2.2 7/00 Data Services Update: Apache Web Server 7
TABLE 1-1 Parameter Configuration Parameters for Sun Cluster HA for Apache (Continued) Description INTERVAL (probe interval) TIMEOUT (probe timeout) TAKEOVER (takeover flag) BIN_DIR (binary directory) CONF_DIR (configuration directory) The time, in seconds, between fault probes. The default interval is 60 seconds. The time, in seconds, after which a fault probe times out. The default timeout value is 30 seconds. The flag that specifies whether a failure of this instance causes a takeover or failover of the logical host associated with the data service instance. Possible values are y (yes) and n (no). The directory of the product installation that contains the httpd binary, for example, /hahost1/apache-home/bin. The directory of the product installation that contains the configuration file httpd.conf, for example, /hahost1/apache-home/conf. 8 Sun Cluster 2.2 7/00 Data Services Update: Apache Web Server July 2000