uCosminexus Application Server, Web Container Functionality Guide

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

4.3.4 Execution environment settings (When the Smart Composer functionality is not 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) Example settings

(1) Setup procedure

To set the distribution of requests by the URL pattern:

  1. Define the worker in workers.properties.
    Specify the list of worker names, worker types (set ajp13), port number, and host name.
    The default value is defined in workers.properties that is provided by default. To use the default definition defined as a comment, delete the hash mark (#) at the beginning of the applicable line.
    For details on workers.properties (worker definition file), see 9.5 workers.properties (worker definition file) in the uCosminexus Application Server Definition Reference Guide.
  2. When using Cosminexus HTTP Server, define the mapping between the URL pattern and worker in mod_jk.conf. When using Microsoft IIS, define the mapping between the URL pattern and worker in uriworkermap.properties.
    If mapping is already defined, delete or replace the definition.
    For details on mod_jk.conf (redirector operation definition file for HTTP Server), see 9.3 mod_jk.conf (redirector operation definition file for HTTP Server) in the uCosminexus Application Server Definition Reference Guide.
    For details on uriworkermap.properties (mapping definition file for Microsoft IIS), see 9.4 uriworkermap.properties (mapping definition file for Microsoft IIS) in the uCosminexus Application Server Definition Reference Guide.
  3. 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 or Appendix C Microsoft IIS Settings.

(2) Example settings

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

Figure 4-6 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 host A is worker1 and the worker name of host B is worker2.

An example of the workers.properties file is shown 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.

Example of workers.properties (In Windows)
worker.list=worker1, worker2
 
worker.worker1.port=8007
worker.worker1.host=hostA
worker.worker1.type=ajp13
worker.worker1.cachesize=64
 
worker.worker2.port=8007
worker.worker2.host=hostB
worker.worker2.type=ajp13
worker.worker2.cachesize=64
 

Example of workers.properties (In UNIX)
worker.list=worker1, worker2
 
worker.worker1.port=8007
worker.worker1.host=hostA
worker.worker1.type=ajp13
 
worker.worker2.port=8007
worker.worker2.host=hostB
worker.worker2.type=ajp13
 

Examples of the mod_jk.conf and uriworkermap.properties files are shown below. Here, the URL pattern /app1/* are mapped with worker1 and the URL pattern /app2/* are mapped with worker2.

Example of mod_jk.conf (In Cosminexus HTTP Server)
JkMount /app1/* worker1
JkMount /app2/* worker2

Example of uriworkermap.properties (In Microsoft IIS)
/app1/*=worker1
/app2/*=worker2