uCosminexus Application Server, Web Container Functionality Guide

[Contents][Glossary][Index][Back][Next]

4.3.3 Execution environment settings (When the Smart Composer functionality is used)

Distributing requests by the URL patterns included in the HTTP requests enables you to execute only the specific processes in the Web container and to distribute requests to multiple Web containers according to the processing contents. Note that, when you use 'Distributing requests by URL pattern' method, as a principle, the requests are distributed in the Web application. Define the URL pattern as an operation of the redirector.

Organization of this subsection
(1) Setup procedure
(2) Settings in the Easy Setup definition file
(3) Example settings

(1) Setup procedure

To set the distribution of requests by the URL pattern:

  1. Define the workers and mapping between the URL pattern and workers in the Easy Setup definition file.
    Specify the list of worker names, worker types (set ajp13), port number, and host name.
    If mapping is already defined, delete or replace the definition.
  2. Set up the Web server environment and restart the Web server.
    For details on the Web server settings, see Appendix B Precautions related to Cosminexus HTTP Server Settings.

(2) Settings in the Easy Setup definition file

Specify the definition for distributing requests by the URL pattern in the <configuration> tag of the logical Web server (web-server) in the Easy Setup definition file.

The following table lists the definitions in the Easy Setup definition file for distributing requests by the URL pattern:

Table 4-5 Definitions in the Easy Setup definition file for distributing requests by the URL pattern

Category Parameter Description
Worker definitions worker.list Specifies a list of one or multiple worker names.
worker.worker-name.host Specifies the worker host name or IP address.
worker.worker-name.port Specifies the worker port number.
worker.worker-name.type Specifies the worker type (ajp13, lb, or post_size_lb).
Worker.worker-name.cachesize Specifies the number of worker connections that are reused in the redirector.
This parameter can only be specified in Windows.
worker.worker-name.receive_timeout Specifies the communication timeout value.
worker.worker-name.delegate_error_code Specifies the error status code used when the creation of the error page is entrusted to the Web server.
Definition of mapping between the URL pattern and worker JkMount Specifies some combination of workers specified in the URL pattern and worker.list.

Note:
Define the name of the workers specified in the worker.list parameter in worker-name.

For details on the Easy Setup definition file and the parameters, see 4.6 Easy Setup definition file in the uCosminexus Application Server Definition Reference Guide.

(3) Example settings

The following figure shows the distribution of requests by the URL patterns.

Figure 4-5 Example of distribution of requests by the URL patterns

[Figure]

In this example, the Web application app1 is deployed on host A and the Web application app2 is deployed on host B. By including the name of the Web application you want to process in the URL pattern of the request, the request with the URL pattern /app1/* can be processed on the host A and the request with the URL pattern /app2/* can be processed on the host B. The worker name of the host A is worker1 and the worker name of the host B is worker2.

An example of the Easy Setup definition file is described below. To distribute the requests to multiple Web containers, specify the worker processes of multiple Web containers as the distribution destinations, in the redirector registered in the Web server. Also, the URL pattern /app1/* are mapped with worker1 and the URL pattern /app2/* are mapped with worker2.

Note that to implement this configuration, you must distribute requests to multiple Web systems.

Example of Easy Setup definition file
 
...
<param>
 <param-name>JkMount</param-name>
 <param-value>/app1/* worker1</param-value>
 <param-value>/app2/* worker2</param-value>
</param>
<param>
 <param-name>worker.list</param-name>
 <param-value>worker1, worker2</param-value>
</param>
<param>
 <param-name>worker.worker1.port</param-name>
 <param-value>8007</param-value>
</param>
<param>
 <param-name>worker.worker1.host</param-name>
 <param-value>hostA</param-value>
</param>
<param>
 <param-name>worker.worker1.type</param-name>
 <param-value>ajp13</param-value>
</param>
<param>
 <param-name>worker.worker1.cachesize</param-name>
 <param-value>64</param-value>
</param>
<param>
 <param-name>worker.worker2.port</param-name>
 <param-value>8007</param-value>
</param>
<param>
 <param-name>worker.worker2.host</param-name>
 <param-value>hostB</param-value>
</param>
<param>
 <param-name>worker.worker2.type</param-name>
 <param-value>ajp13</param-value>
</param>
<param>
 <param-name>worker.worker2.cachesize</param-name>
 <param-value>64</param-value>
</param>
...