2 Configuring the mod_wl_ohs Plug-In for Oracle HTTP Server

This chapter describes how to configure mod_wl_ohs, which is the plug-in for proxying requests from Oracle HTTP Server to Oracle WebLogic server. The mod_wl_ohs module is included in the Oracle HTTP Server installation. You need not download and install it separately.

Note:

mod_wl_ohs provides features that are identical to those of the plug-in for Apache HTTP Server.

You can configure mod_wl_ohs either by using Fusion Middleware Control or by editing the mod_wl_ohs.conf configuration file manually.

This chapter contains the following topics:

2.1 Prerequisites for Configuring mod_wl_ohs

Before you begin configuring mod_wl_ohs, do the following:

  • Ensure that Oracle WebLogic Server has been installed, a domain has been created, and you can access the Oracle WebLogic Server administration console.

  • Verify that Fusion Middleware Control has been installed and you can access the Enterprise Manager Console. This is required if you want configure mod_wl_ohs by using the graphical interface provided by Fusion Middleware Control.

  • To be able to test the configuration, make sure that the required Java applications are deployed to Oracle WebLogic Server—either to a single managed server or to a cluster—and are accessible.

  • If the version of the Oracle WebLogic Server instances in the back end is 10.3.4 (or later releases), you must set the WebLogic Plug-In Enabled parameter.

    1. Log in to the Oracle WebLogic Server administration console.

    2. In the Domain Structure pane, expand the Environment node.

      • If the server instances to which you want to proxy requests from Oracle HTTP Server are in a cluster, select Clusters.

      • Otherwise, select Servers.

    3. Select the server or cluster to which you want to proxy requests from Oracle HTTP Server.

      The Configuration: General tab is displayed.

    4. Scroll down to the Advanced section, expand it, and select the WebLogic Plug-In Enabled check box.

    5. If you selected Servers in step 2, repeat steps 3 and 4 for the other servers to which you want to proxy requests from Oracle HTTP Servers.

    6. Click Save.

    For the change to take effect, you must restart the server instances.

2.2 Configuring mod_wl_ohs Using Fusion Middleware Control

To configure the mod_wl_ohs module using Fusion Middleware Control, do the following:

  1. Make sure that you have fulfilled the prerequisites listed in Section 2.1.

  2. Select Administration from the Oracle HTTP Server menu.

  3. Select mod_wl_ohs Configuration from the Administration menu. The mod_wl_ohs Configuration page is displayed.

    Server properties screen
    Description of the illustration mod_wl_ohs.gif

  4. Specify the configuration settings as described in the online help, which you can invoke by clicking the help icon on the page.

  5. Review the settings.

    If the settings are correct, click Apply to apply the changes. If the settings are incorrect, or you decide to not apply the changes, click Revert to return to the original settings.

  6. Restart Oracle HTTP Server by selecting Control from the Oracle HTTP Server menu, and then selecting Start Up.

The mod_wl_ohs module configuration is saved and shown on the mod_wl_ohs Configuration page.

2.3 Configuring mod_wl_ohs Manually

You can configure mod_wl_ohs manually by specifying directives in the mod_wl_ohs.conf file.

  1. Make sure that you have fulfilled the prerequisites listed in Section 2.1.

  2. Open the mod_wl_ohs.conf file, which is located in the following directory, in a text editor:

    ORACLE_INSTANCE/config/OHS/component_name
    
  3. Look for the <IfModule weblogic_module> element.

  4. Add directives within the <IfModule weblogic_module> element in the configuration file, as follows:

    Note:

    Oracle recommends that you specify directives within the predefined <IfModule weblogic_module> element.

    If you specify directives outside the predefined <IfModule weblogic_module> element, or in additional <IfModule weblogic_module> elements, or in configuration files other than mod_wl_ohs.conf, the mod_wl_ohs module might work, but the configuration state of the module, as displayed in Fusion Middleware Control, could be inconsistent with the directives specified in the mod_wl_ohs.conf configuration file.

    • To forward requests to an application running on a single Oracle WebLogic Server instance, specify the details of that destination server within a <location> element.

      Syntax:

      <IfModule weblogic_module>
      <Location path>
      SetHandler weblogic-handler
      WebLogicHost host
      WeblogicPort port
      </Location>
      </IfModule>
      

      Example:

      With the following configuration, requests for the /myapplication URI received at the Oracle HTTP Server listen port will be forwarded to /myapplication on the Oracle WebLogic Server with the listen port localhost:7001

      <IfModule weblogic_module>
      <Location /myapp1>
      SetHandler weblogic-handler
      WebLogicHost localhost
      WeblogicPort 7001
      </Location>
      </IfModule>
      
    • To forward requests to an application running on a cluster of Oracle WebLogic Server instances, specify the details of that destination cluster within a new <location> element.

      Syntax:

      <IfModule weblogic_module>
      <Location path>
      SetHandler weblogic-handler
      WebLogicCluster host:port,host:port,...
      </Location>
      </IfModule>
      

      Example:

      With the following configuration, requests for the /myapplication URI received at the Oracle HTTP Server listen port will be forwarded to /myapplication the Oracle WebLogic Server cluster containing the managed servers with the listen ports localhost:8002 and localhost:8003.

      <IfModule weblogic_module>
      <Location /myapp2>
      SetHandler weblogic-handler
      WebLogicCluster localhost:8002,localhost:8003
      </Location>
      </IfModule>
      
    • To configure multiple destinations—say, an application running on a single Oracle WebLogic Server instance and another application running on a cluster—you must specify each destination in a distinct <location> child element. Note that all the <location> child elements should be at the same level within the <IfModule weblogic_module> element, as shown in the following syntax:

      <IfModule weblogic_module>
      
      #For an application running on a single server instance
      <Location path1>
      SetHandler weblogic-handler
      WebLogicHost host
      WeblogicPort port
      </Location>
      
      #For an application running on a cluster
      <Location path1>
      SetHandler weblogic-handler
      WebLogicCluster host:port,host:port,...
      </Location>
      
      </IfModule>
      

    For information about the other directives that you can specify in the mod_wl_ohs.conf file, see Chapter 7, "Parameters for Web Server Plug-Ins.".

  5. Restart Oracle HTTP Server by using the following command:

    > $ORACLE_INSTANCE/bin/opmnctl startproc ias-component=component_name
    

2.4 Configuring SSL for mod_wl_ohs

For information about configuring mod_wl_ohs to support one-way and two-way SSL between Oracle HTTP Server and Oracle WebLogic Server, see "Enable SSL for Outbound Requests from Oracle HTTP Server" in the Oracle Fusion Middleware Administrator's Guide.