Chapter 9 Web Server Redirector Plug-In


Plug-in overview

The EAServer application server hosts Web applications and functions as a Web server. In earlier versions, a client was required to use EAServer to access its servlet facilities and hosted Web applications. The redirector plug-in is installed on the Web server host and allows you to send client requests directly to the Web server, which forwards requests to EAServer that need to access EAServer servlets, JSPs, and so on. EAServer processes the requests and returns the results back to the Web server. Table 9-1 lists the platforms and Web servers for which the redirector plug-in is available.

Table 9-1: Redirector plug-in support
Platform Web servers supported
Windows NT and Windows 2000 Netscape 3.6.x, Apache 1.3, IPlanet 4.1, Microsoft IIS (Internet Information Server) 4.0 and 5.0
Solaris Netscape 3.6.x and 4.x, IPlanet 4.1, Apache 1.3

Note   Throughout this chapter, the $JAGUAR and %JAGUAR% variables are represented as JAGUAR_HOME. In some instances, forward slashes are used to separate directories for both Solaris and Windows platforms.

How the plug-in works

As Figure 9-1 illustrates, the redirector plug-in forwards HTTP requests to EAServer. For Web servers to forward requests, you must:

  1. Install the redirector plug-in on the Web server.
  2. Edit the Web server configuration file to:

  3. Edit the redirector configuration file to define the application servers to which the redirector sends requests.

    Note   Absolute path names containing spaces should be quoted. Use forward slashes in path names not back slashes.

  4. Configure EAServer so it accepts requests from the redirector.

Note   Although the process for installing and configuring the redirector plug-in is similar for each Web server, the name of the redirector plug-in file, Web server configuration file, and the redirector configuration file may vary. See the section for your particular Web server when installing and configuring the redirector plug-in.

Figure 9-1: HTTP request flow through the redirector

Load balancing

Load balancing is transparent to the client. The redirector detects and directs requests from existing sessions to EAServer using either the J2EE cookie or the J2EE session identifier that is part of the HTTP request. If the cookie or identifier is missing, the client is treated as a new client, otherwise, the redirector sends the request to the EAServer that originally established the session.

New requests are directed to different application servers that share and balance the load. Load balancing is based on a round-robin scheme. If a redirector is configured to service n number of application servers, and a new request arrives at the redirector, it is directed to the next application server in its list (as defined by the redirector configuration file) that has not previously serviced a request. The next new request is sent to the next available server, and so on.

In Figure 9-2, the Web server redirector has an entry in the redirector configuration file that directs requests for the "examples" Web application to three application servers: jag1, jag2, and jag3. Requests for the Web application are distributed evenly across all three servers.

Figure 9-2: redirector configuration file entry

Failover and detecting unavailable application servers

The redirector provides failover for Web applications. However, to achieve transparent failover, you must mark your Web application as "distributable" in EAServer using Jaguar Manager. This allows the HttpSession object created by the Web application to be visible to other application servers. See Chapter 19, "Creating Web Applications," in the EAServer Programmer's Guide for information about distributable Web applications.

When a request arrives from a client, the redirector sends it to an application server. The redirector selects the application server based on a round-robin scheme where each new request from a client is directed to the next available server that can service the request. If an application server is not responding to a request from a client (for example, temporarily down for administrative reasons), the redirector marks the server unavailable for a fixed period of time and sends the request to the next application server that can service the request.

If a request arrives from a client and an application server has been unavailable for more than the retry value, the redirector sends the request to this unavailable application server. If the application server responds, it is marked as "available."

The default retry value is 300 seconds (five minutes). You can change the default by adding this directive to the redirector configuration file:

Connector.RetryAfter <seconds>

where seconds is the number of seconds the application server is unavailable.

See "Editing the redirector configuration file" on page § (Netscape and IPlanet), § (Apache), or § (IIS) for more information.

 


Copyright © 2002 Sybase, Inc. All rights reserved.