Sun Java System Web Server 7.0 Update 7 Administrator's Guide

Cluster Environment

A cluster is a group of multiple server instances spanning across more than one node, all running identical configurations. All instances in a cluster work together to provide high availability, reliability, and scalability.

With load balancing, a cluster offers uninterrupted service and session data persistence by providing failover and session replication.

Hardware and Software Requirements

The use case described in this section, consists of the following entities:

1) Four instances (running on four identical nodes) 

2) An Administration Server 

3) A reverse proxy for load balancing HTTP requests 

To set up a cluster, you need two or more identical nodes with the same operating system version and patches. For example, if you select a machine with Solaris® 9 SPARC® operating system, other machines in the cluster must also have Solaris 9 SPARC installed.

For information on supported platforms and patch requirements, see the Sun Java System Web Server 7.0 Update 7 Release Notes.

The following figure describes a clustered environment.

Figure 4–2 Cluster Set Up

Figure representing the cluster set up.

In the preceding figure, nodes are configured in the De-Militarized Zone (DMZ). The Administration Server is configured behind a firewall, the Militarized Zone, to restrict and protect the Administration Server against general access. Another node is configured as the Reverse Proxy Server. A reverse proxy server resides inside the DMZ to enhance security.

Note –

The Solaris zone feature is supported only on Solaris 10 operating system.

Setting Up a Cluster

This section describes the procedure to set up the cluster and enable reverse proxy to support load-balancing on HTTP requests.

The following flowchart illustrates the procedure to set up a cluster.

Figure 4–3 Flowchart illustrating the cluster set up

Flowchart illustrating the steps to set up a

  1. On one of the nodes, install Web Server that acts as the Administration Server in a cluster.

  2. On the other three nodes, install the Web Server. Select the option of installing Web Server as an Administration Node. During the installation, choose the option of registering the node with the server.

  3. Make sure the Administration Server is using SSL port for communication, as an Administration Node can be registered with the server only in secure mode.

  4. Make sure the system date and time on all the nodes where the Administration Server and the Administration Nodes are installed are the same. The certificate associated with the server is created based on the system date and time of the node where the Administration Server is installed. If the system date of the Administration Node is earlier than the Administration Server, the registration fails as the certificate of the Administration Server will not yet be valid. As a corollary, the certificate may be deemed valid if it is has expired.

  5. Start the Administration Server from the install_dir/admin-server/bin/ directory.


  6. Start the wadm command-line tool from the Administration Node. The wadm command-line tool is located in the install_dir/bin directory.


  7. Register each Administration Node with the Administration Server. Use the register-node command to register each node with the server.

    For Example:

    ./wadm register-node -user=admin --port=8989


    is the host name of the Administration Server to which you are registering the Node.


    is the SSL Port number of the Administration Server.

  8. You will be prompted to enter the administration password. Enter the administration password of the Administration Server.

    The Administration Server authenticates by the Administration Server trusting the Administration Node's server certificate and the Administration Node trusting the client certificate presented by the Administration Server. During registration of an Administration Node, the Administration Server generates a server certificate for that Administration Node, which is then downloaded and installed on the Administration Node. The issuer of the server certificate is also installed on the Administration Node.

    Note –

    The registration can be done only over SSL.

    For information about registering nodes, see Registering the Administration Node From the Command-Line in Sun Java System Web Server 7.0 Update 7 Installation and Migration Guide.

  9. Start all the Administration Nodes using the startserv command from the install_dir/admin-server/bin/ directory.

  10. Using the Admin Console or the CLI, create a new configuration in the Administration Server.

    Provide configuration information such as configuration name, HTTP Listener port, and the server name for the new configuration.

  11. Create instances of the configuration on all the nodes.

  12. Start the instances on all the nodes.

    Note –

    Web Server provides the flexibility to expand or reduce your cluster. You can add or remove instances to the cluster at any point of time.

Configuring Reverse Proxy in Web Server 7.0

The Sun Java System Web Server 7.0 integrates the reverse proxy functionality within the core server.

When web server is configured with reverse proxy functionality, it acts as a proxy for one or more backend servers and serves as a single point of access or gateway in a server farm. In a reverse proxy setup, the web server forwards the HTTP request it received from the browser client to the appropriate backend server. The HTML response from the backend server is sent back to the browser through the web server. Thus, the web server with reverse proxy hides the existence of backend servers.

Figure 4–4 Reverse Proxy Setup

Reverse proxy setup

Web Server 7.0 with reverse proxy functionality acts as a simple software load balancer with the added ability to forward the sticky requests back to the same backend server.

Web server with reverse proxy can serve static content like gif and html files from its internal cache. At the same time, it functions as a load balancer and processes request for dynamic content like jsp, servlet or php files to the backend server. When web server is deployed in this configuration, disabling the Java web container will significantly reduce the memory footprint of the server. For information about disabling Java web container, see Tuning Web Container Within Web Server 7.0 in Sun Java System Web Server 7.0 Update 7 Performance Tuning, Sizing, and Scaling Guide. See CLI Reference, disable-java(1).

The advantages of reverse proxy within Web Server 7.0 are:

Note –

In a typical deployment, one or more reverse proxies will be deployed between the browsers and the backend servers.

Configuring Reverse Proxy for Load-balancing

Web Server 7.0 provides a sophisticated built-in load balancer, the reverse proxy, which distributes load or request from the client to several backend servers.

Web Server provides GUI and CLI support for configuring the reverse proxy.

ProcedureConfiguring Reverse Proxy Using Administration Console

  1. Install Web Server on the node that you want to use for configuring reverse proxy.

  2. Create a configuration. For example, rp.

  3. Using the Administration Console, select Configurations > Virtual Servers > Content Handling > Reverse Proxy tab. Click New.

  4. Specify values for the following parameters:

    • URI — The reverse proxy URI

    • Server URL — Comma separated server URLs of all the machines in the cluster separated by comma. If multiple values are given, the server will distribute load among the specified servers.

      The format for entering the server URL is hostname:portnumber. For example, http://<content server-hostname>:port

  5. Click the OK button.

  6. Click the Deployment Pending link in the top right of the screen to deploy the modified configuration and to apply changes to the configuration.

  7. Click the Deploy button.

    Deployment successful message appears.

  8. Start all instances of this modified configuration.

    This completes configuring the reverse proxy for load balancing HTTP requests.

    Note –

    To configure a reverse proxy in a cluster environment, issue a wildcard server certificate or the alternate subject names that can be set to the actual origin server host names. The other option of specifying the original server's host names in the subject name field limits the size of the cluster, leading the cluster to fail if another node is added to the cluster.

    A wildcard server certificate can be created using the administration interfaces. After creating the server certificate use certutil to get the base64 encoded version of the certificate and install it as a trusted CA certificate on the load balancer configuration.

    Type the following command to generate the base64 encoded certificate bash$./certutil -L -a -d instancedir/config. Copy the output of the command and paste it in the install certificate wizard.

ProcedureConfiguring Reverse Proxy Using CLI

Perform the following steps to configure reverse proxy in CLI mode. You will create a configuration config1 and an instance rp as reverse proxy.

  1. Start the Administration Server:

    $ <install-dir>/admin-server/bin/startserv

  2. Invoke the CLI shell:

    <install-dir>/admin-server/bin/wadm -user <username>

    You can see the wadm shell

  3. Create config1:

    wadm>create-config --http-port=8080 --server-name=config1 --server-user=root config1

  4. Create an instance for the config1 configuration:

    wadm>create-instance --config=config1 <host-name>

  5. Add the web application on the created configuration:

    wadm>add-webapp --config=config1 -vs=config1 --uri/test <warfile>

  6. Deploy the web application.

    wadm>deploy-config --user=admin --password-file=admin.pwd --host=serverhost --port=8989 config1

  7. Create a rp configuration:

    wadm>create-config --http-port=8081 --server-name=rp --server-user=root rp

  8. Enable the rp configuration to reverse proxy using the following command:

    wadm> create-reverse-proxy --user=admin --password-file=admin.pwd 
    --host=serverhost --config=rp --vs=rp --uri-prefix=// 

    To redirect to a secure site, follow the same step and provide the https address for the --server option.

    See CLI Reference, create-reverse-proxy(1).

  9. Create an instance for the rp configuration.

    wadm>create-instance --config=rp <host-name>

  10. Start the instances:

    wadm>start-instance --config=config1 <host-name>

    wadm>start-instance --config=rp <hostname>

    The web application deployed in config1 can be viewed through rp instance.

    http://<rp instance hostname>:8081/test

    See CLI Reference, list-reverse-proxy-uris(1), set-reverse-proxy-prop(1), get-reverse-proxy-prop(1), forward-reverse-proxy-header(1), block-reverse-proxy-header(1), and list-reverse-proxy-headers(1)

Modifying Reverse Proxy Parameters

ProcedureTo Modify Reverse Proxy Parameters

  1. Using the Administration Console, select Configurations > Virtual Servers > Content Handling > Reverse Proxy tab.

  2. Click the URI button.

    You can edit the following parameters:

    • URI — The reverse proxy URI

    • Server URL — Comma separated URLs of the remote server. If multiple values are given, the server will distribute load among the specified servers.

    • Sticky Cookie — Name of a cookie that when present in a response, will cause subsequent requests to stick to that origin server.

    • Sticky URI Parameter — Name of a URI parameter to inspect for route information. When the URI parameter is present in a request URI and its value contains a colon `:' followed by a route ID, the request will "stick" to the origin server identified by that route ID.

    • Route Header — Name of the HTTP request header used to communicate route IDs to origin servers.

    • Route Cookie — Name of the cookie generated by the server when it encounters a sticky cookie in a response. The route cookie stores a route ID that enables the server to direct subsequent requests back to the same origin server.

    • Rewrite Headers — Comma separated list of HTTP request headers.

Configuring Timeout Parameter in Reverse Proxy

  1. Using the Administration Console, select Configurations > Virtual Servers > Content Handling > Reverse Proxy tab.

  2. Click the URI button.

    A new window appears.

  3. Click the HTTP Client Configuration link.

    You can edit the Idle Timeout parameter. The default value is 300.

Customizing Reverse Proxy

You can configure conditional request processing in reverse proxy by manually editing the virtual server specific obj.conf file or through CLI. After the configuration changes are done, it is recommended to deploy the configuration and start the instance so that the changes are implemented.

wadm>deploy-config config_name

wadm>start-instance --config config_name hostname

See CLI Reference, deploy-config(1), start-instance(1)

Note –

The appropriate obj.conf file used by your virtual server should be modified. It can be <vs>-obj.conf or the default obj.conf, depending on the configuration.

The following examples discuss some of the possible configurations in Web Server.