13.7.3. Configure NSAPI as a Basic HTTP Connector

Overview

This task configures the NSAPI connector to redirect client requests to JBoss Enterprise Application Platform servers with no load-balancing or fail-over. The redirection is done on a per-deployment (and hence per-URL) basis. For a load-balancing configuration, refer to Section 13.7.4, “Configure NSAPI as a Load-balancing Cluster” instead.

Prerequisites

Procedure 13.16. Task

  1. Define the URL paths to redirect to the JBoss Enterprise Application Platform servers.

    Edit the IPLANET_CONFIG/obj.conf file. Locate the section which starts with <Object name="default">, and add each URL pattern to match, in the format shown by the example file below. The string jknsapi refers to the HTTP connector which will be defined in the next step. The example shows the use of wild-cards for pattern matching.
    <Object name="default">
          [...]
       NameTrans fn="assign-name" from="/status" name="jknsapi"
       NameTrans fn="assign-name" from="/images(|/*)" name="jknsapi"
       NameTrans fn="assign-name" from="/css(|/*)" name="jknsapi"
       NameTrans fn="assign-name" from="/nc(|/*)" name="jknsapi"
       NameTrans fn="assign-name" from="/jmx-console(|/*)" name="jknsapi"
    </Object>
    
  2. Define the worker which serves each path.

    Continue editing the IPLANET_CONFIG/obj.conf file. Add the following directly after the closing tag of the section you have just finished editing: </Object>.
    <Object name="jknsapi">
       ObjectType fn=force-type type=text/plain
       Service fn="jk_service" worker="worker01" path="/status"
       Service fn="jk_service" worker="worker02" path="/nc(/*)"
       Service fn="jk_service" worker="worker01"
    </Object>
    
    The example above redirects requests to the URL path /status to the worker called worker01, and all URL paths beneath /nc/ to the worker called worker02. The third line indicates that all URLs assigned to the jknsapi object which are not matched by the previous lines are served to worker01.
    Save and exit the file.
  3. Define the workers and their attributes.

    Create a file called workers.properties in the IPLANET_CONFIG/connectors/ directory. Paste the following contents into the file, and modify them to suit your environment.
    # An entry that lists all the workers defined
    worker.list=worker01, worker02
    
    # Entries that define the host and port associated with these workers
    worker.worker01.host=127.0.0.1
    worker.worker01.port=8009
    worker.worker01.type=ajp13
    
    worker.worker02.host=127.0.0.100
    worker.worker02.port=8009
    worker.worker02.type=ajp13
    
    The workers.properties file uses the same syntax as Apache mod_jk. For information about which options are available, refer to Section 13.4.4, “Configuration Reference for Apache Mod_jk Workers”.
    Save and exit the file.
  4. Restart the iPlanet Web Server.

    Choose one of the following procedures, depending on whether you run iPlanet Web Server 6.1 or 7.0.
    • iPlanet Web Server 6.1

      IPLANET_CONFIG/../stop
      IPLANET_CONFIG/../start
      
    • iPlanet Web Server 7.0

      IPLANET_CONFIG/../bin/stopserv
      IPLANET_CONFIG/../bin/startserv
      
Result

iPlanet Web Server now sends client requests to the URLs you have configured to deployments on the JBoss Enterprise Application Platform.