Back to Contents


Configuring the GAS Connector

To include a Web server in your solution, you must install the GAS Connector on the host of the Web server.  Once the GAS Connector is installed, you modify the configuration file connector.xcf and define how the Web server routes its application requests, provide load-balancing of applications across application servers, and what error messages display.

Topics

Important: This help topic provides examples of common configuration needs. For a complete listing of all configuration options, see the Connector Configuration Reference.


What is a GAS Connector?

A GAS Connector allows a Web server to handle requests from the user agent to the Genero Application Server daemon (gasd). The GAS Connector can dispatch requests to different Application Server daemons based on the requested application, resulting in load balancing of applications. The configuration of the GAS Connector is completed in the connector.xcf file.

The Connector configuration file is installed on the webserver in the directory <webserver>/<script>, where webserver is the document root directory and script the executables directory. See Installation for more information on installing and locating the Connector configuration file,

Back to the top


Routing an application request

When the GAS Connector receives an application request, it needs to know two things: the application server host and the port number where the application server is listening for new requests. This server and port number information must be provided in the configuration file.

Within the REQUEST_LIST element, you define REQUEST elements that specify the server and port offset information for an application request for a named application (specified by the Id tag).  Create a REQUEST element for each application you wish to specifically route. Using a REQUEST element routes an application to one or more application servers based on its application Id.  This allows you to effectively run an application on a dedicated server, if that is a need. You also have a DEFAULT element, specifying the server and port offset for application requests not explicitly named in any REQUEST element. If you have no application servers defined in the DEFAULT element, then only applications whose Id matches a REQUEST element will be run.

Elsewhere, within the INTERFACE_TO_APPLICATION_SERVER element, you define a single base port value in the TCP_BASE_PORT element. This value is added to the port offset to identify the port number where the application server is listening for application requests.

Example:

01 <CONFIGURATION>
02  <CONNECTOR>
03    <INTERFACE_TO_APPLICATION_SERVER>
04      <TCP_BASE_PORT>6300</TCP_BASE_PORT>
05    </INTERFACE_TO_APPLICATION_SERVER>
06    <REQUEST_LIST>
07      <DEFAULT>
08        <SERVER>server_1:94</SERVER>
09      </DEFAULT>
10      <REQUEST Id="Edit">
11        <SERVER>server_3:95</SERVER>
12     </REQUEST>
13   </REQUEST_LIST>
14 ... 
15 </CONFIGURATION>

In this example:

For detailed configuration guidance, refer to the Connector Configuration Reference.

Back to the top


Load balancing application requests

As discussed in the previous section, the REQUEST and DEFAULT elements of the GAS Connector configuration file specifies to which server an application request is routed.

Balancing requests by application name

One method of load balancing is to have specific application servers dedicated to handling specific application requests. In this setup, you simply add the requisite REQUEST elements to the configuration file.

01 <CONFIGURATION>
02  <CONNECTOR>
03  ...
04    <REQUEST_LIST>
05      <DEFAULT>
06        <SERVER>server_1:94</SERVER>
07      </DEFAULT>
08      <REQUEST Id="Edit">
09        <SERVER>server_3:94</SERVER>
10     </REQUEST>
11     <REQUEST Id="Button">
12       <SERVER>192.168.0.10:94</SERVER>
13     </REQUEST>
14   </REQUEST_LIST>
15 ... 
16 </CONFIGURATION>

In this example, application requests are balanced across three servers:

Balancing across application servers

A second method of load balancing is to have multiple application servers handle requests for one application. This method is useful when a single application server cannot keep up with the number of requests being sent to it. To distribute application requests across multiple application servers, define multiple SERVER elements within the REQUEST or DEFAULT element. Balancing the requests across the listed servers is managed by the GAS Connector. The requests are evenly spread across the servers listed.

01 <CONFIGURATION>
02  <CONNECTOR>
03  ...
04    <REQUEST_LIST>
05      <DEFAULT>
06        <SERVER>server_1:94</SERVER>
07        <SERVER>server_2:94</SERVER>
08      </DEFAULT>
09      <REQUEST Id="Edit">
10        <SERVER>server_3:94</SERVER>
11        <SERVER>server_4:94</SERVER>
12     </REQUEST>
13     <REQUEST Id="Button">
14       <SERVER>192.168.0.10:94</SERVER>
15     </REQUEST>
16   </REQUEST_LIST>
17 ... 
18 </CONFIGURATION>

In this example, requests are routed across six application servers:

For detailed configuration guidance, refer to the Connector Configuration Reference.

Back to the top


Setting the error messages

The administrator specifies the errors that display when the application cannot be served. The default installation provides html files that display appropriate error pages for six common error types. The administrator can customize these html files or change other error-related settings.

Syntax:

<ERROR_LIST>
  <ERROR Id="num">
    <HTTP_STATUS>status</HTTP_STATUS>
    <HTTP_HEADER Id="hname">hvalue</HTTP_HEADER> [...]
    <BODY_FILE>errfile</BODY_FILE>
  </ERROR>
<ERROR_LIST>

Notes:

  1. num is the error identifier
  2. status is the http status
  3. hname is the http header name, for example Pragma
  4. hvalue is the hname value, for example no-cache
  5. errfile is the file to display when the error occurs

Genero Web Services Notes:

  1. For SOAP errors, status is ignored and set to "500 Internal Server Error" as specified in Simple Object Access Protocol (SOAP) 1.1 - 6.2 SOAP HTTP Response.

Example:

01 <ERROR_LIST>
02   <ERROR Id="1">
03     <HTTP_STATUS>400 Bad Request</HTTP_STATUS>
04     <HTTP_HEADER Id="Pragma">no-cache</HTTP_HEADER>
05     <BODY_FILE>connector-error-1</BODY_FILE>
06   </ERROR>
07  ... 
08   <ERROR Id="3">
09     <HTTP_STATUS>404 Not Found</HTTP_STATUS>
10     <HTTP_HEADER Id="Pragma">no-cache</HTTP_HEADER>
11     <BODY_FILE>connector-error-3</BODY_FILE>
12   </ERROR>
13   ... 
14 </ERROR_LIST>

For detailed configuration guidance, refer to the Connector Configuration Reference.

Back to the top