Skip Headers

Oracle HTTP Server Administrator's Guide
10g (9.0.4)

Part Number B10381-01
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

A
Using Oracle Application Server Proxy Plug-in

This appendix explains how the Oracle Application Server Proxy Plug-in enables you to use components in conjunction with a third-party HTTP listener. The Oracle Application Server Proxy Plug-in works with the Sun ONE Web Server Enterprise Edition, version 4.1 and 6.0, on UNIX and Windows NT systems, or the Microsoft Internet Information Server (IIS), version 4.0 or 5.0 on Windows systems, to send requests to Oracle Application Server.

Topics discussed are:

Overview

Oracle Application Server Proxy Plug-in is a reverse HTTP proxy. The plug-in forwards incoming HTTP requests to an Oracle Application Server instance as shown in Figure A-1.

Figure A-1 Oracle Application Server Proxy Plug-in

Text description of proxya.gif follows

Text description of the illustration proxya.gif

This proxy logic is provided as a plug-in, a shared library that is loaded by the third-party HTTP listeners. The plug-in uses APIs provided with the third-party listeners to directly handle HTTP requests, in much the same way that modules are plugged into Oracle HTTP Server.

Oracle HTTP Server can mimic the address and port that the third-party listener is using. That is, when sending a request to Oracle HTTP Server, the proxy can be configured to send a different Host: HTTP header than the actual hostname and port that the request is being sent to, so that downstream applications are shielded from the introduction of the reverse proxy.

Downloading Proxy Plug-in

The plug-in is distributed on the OracleAS Repository Creation Assistant/Utilities CD, which is included in your Oracle Application Server CD Pack.

Installing Proxy Plug-in

After downloading the plug-in, place the configuration files and shared library in directories that the third-party listener can access.

Installing Proxy Plug-in on UNIX Systems

The plug-in consists of a single shared library, oracle_proxy.so. To install the plug-in into the listener, place the library in a directory to which the listener has read and execute privileges.

Installing Proxy Plug-in on Windows Systems

The plug-in consists of a single .dll, oracle_proxy.dll for IIS, or oracle_proxy_nes.dll for Sun ONE. To install this plug-in, copy the .dll to a directory the listener can access.

Using Application Server Control

When you install Oracle Application Server, you can administer Oracle HTTP Server using Application Server Control. However, if you choose to use Sun ONE or IIS instead of Oracle HTTP Server, then it is recommended that you disable Oracle HTTP Server on Application Server Control so that it no longer appears there.

Oracle does not support monitoring or administering of non-Oracle HTTP Server listener with Application Server Control.

See Also:

Configuring Proxy Plug-in

There is one configuration file for Oracle Application Server Proxy Plug-in. It controls the proxy functionality. The presence of the configuration file in the Web server's file system makes the functionality active.

You also need to modify configuration files specific to the third-party listener to enable the plug-in on to these listeners.

Proxy Server Definition File

The proxy server definition file must reside in a directory that is readable by the third-party listener. For simplicity, you could create a directory called proxy in a convenient location on your system, and place the proxy server definition file, the proxy module file (oracle_proxy.dll for Windows NT IIS, oracle_proxy_nes.dll for NT Sun ONE, or oracle_proxy.so for Solaris Sun ONE), and proxy log files in it.

Described in detail in Proxy Configuration File Parameters section below, the proxy server definition file contains:

You can create this file with the text editor of your choice. The oproxy.serverlist parameter must list at least one server name, or the proxy will not function.

Example A-1 provides a sample proxy server definition file.

Example A-1 Sample Proxy Server Definition File

# This file defines proxy server behavior. 
#
# Server names that the proxy plug-in will recognize. 
oproxy.serverlist=ias1

# Hostname to use when communicating with a specific server. 
oproxy.ias1.hostname=oasdocs.us.oracle.com

# Port to use when communicating with a specific server. 
oproxy.ias1.port=7777

# Description of URL(s) that will be redirected to this server. 
oproxy.ias1.urlrule=/*

Proxy Configuration File Parameters

The following section discusses the proxy configuration file parameters listed below:

oproxy.serverlist

Lists all of the server names that the plug-in recognizes.

Category Value

Parameter Type

string list

Allowable Values

Comma separated list of server names, one for each Oracle HTTP Server to which requests will be sent. All servers in the serverlist must also be defined in the file.

Default Value

None. At least one server name must be provided for the proxy to be functional.

Example

oproxy.serverlist=ias1,ias2

oproxy.servername.hostname

Defines the hostname to use when communicating with a specific server.

Category Value

Parameter Type

string

Allowable Values

Valid hostname

Default Value

None.

Example

oproxy.ias1.hostname=www1.us.oracle.com

oproxy.servername.port

defines the port to use when communicating with a specific server.

Category Value

Allowable Values

Valid port value

Default Value

80.

Example

oproxy.ias1.port=7777

oproxy.servername.alias

Supports the mimicing feature of the proxy by defining the hostname and port that clients use to access the third-party HTTP listener. If defined, this value will be passed as the Host: HTTP header. If not defined, the hostname and port of the machine actually being communicated with will be sent.

Category Value

Parameter Type

string

Allowable Values

host:port

Default Value

oproxy.servername.hostname:oproxy.servername.port

Example

oproxy.ias1.alias=www.oracle.com:80

oproxy.servername.urlrule

Describes a URL or set of URLs that are redirected to this server. A given server can have any number of urlrule properties assigned to it.

Category Value

Parameter Type

string

Example

oproxy.ias1.urlrule=/foo/*

Three types of rules can be used: exact match, context match, or suffix match.

Defining Proxy Plug-in Behavior

In the proxy server definition file, you define which servers and URLs to proxy to the plug-in.

  1. In the first line of the file, specify the list of all the servers that can be used by the plugins. For example:

    oproxy.serverlist=ias1,ias2
    
    
  2. Set the relevant properties (hostname, port, and server alias) for each server. For example:

    oproxy.ias1.hostname=myhost.us.oracle.com
    oproxy.ias1.port=7777
    oproxy.ias1.alias=www.oracle.com
    
    

    The hostname must be provided. If you do not specify the port, 80 is assigned. If an alias value is not given, the combination of the hostname and port given are used. The alias enables the back end server to receive requests that have an HTTP Host: header that looks exactly like the one the client delivers to the third-party listener.

  3. Set the urlrule parameter to specify redirection between servers. For example, the rule:

    oproxy.ias1.urlrule=/*
    
    

    maps all incoming requests to be proxied to the Web server on the server ias1. These rules can be of three forms, exact URL, context match, or extension-based. An exact match maps exactly one URL to a server, for example:

    oproxy.ias1.urlrule=/my/path/index.html
    
    

    maps only accesses to /my/path/index.html for proxying. An example of a context rule is:

    oproxy.ias1.urlrule=/app1/*
    
    

    which maps any URL beginning with /app1. An extension-based rule, such as:

    oproxy.ias1.urlrule=/*.jsp
    
    

    maps any URL ending with .jsp.

    All requests sent to a mapped URL are proxied through HTTP/1.1 to the specified server.

Configuring Sun ONE Listener to Use Proxy Plug-in

This section provides proxy plug-in configuration instructions for Sun ONE Enterprise Server listener on UNIX and Windows NT systems.


Notes:

If you are configuring the Sun ONE listener on Windows NT, use forward slashes (/) in all paths.

The default configuration files for Sun ONE route all incoming requests for the URI /servlet to the Sun ONE servlet handler. The Oracle Application Server Proxy Plug-in does not override settings configuration settings. You must ensure that the URL mappings to the Oracle Application Server Proxy Plug-in are distinct from the URL mappings to the Sun ONE servlet engine.


  1. Open the magnus.conf file in version 6, or obj.conf in version 4 in the Sun ONE listener /config directory.

  2. Add the load-modules line:

    On UNIX:

    Init fn="load-modules" shlib="/path/oracle_proxy.so" funcs=op_init,op_
    objecttype,op_service
    
    

    On Windows:

    Init fn="load-modules" shlib="/path/oracle_proxy_nes.dll" funcs=op_init,op_
    objecttype,op_service
    
    

    where /path/ is the path to the shared library for the plug-in. This line tells the listener where the proxy shared library is, and which functions are exposed by this library.

  3. Add the configuration parameters line:

    Init fn="op_init" server_defs="/path/servers"
    logfile="/path/oproxy.log" log_level=error
    
    

    where /path/ is the path to the proxy server definition and log files. The proxy server definition file contains all of the configuration information for the servers that the proxy plug-in can communicate with. A log file and log level to log messages from the plug-in can also be specified (optional).

    See Also:

    "Proxy Server Definition File" for a complete description and example.

  4. Add the following line to the <Object name=default> section of the obj.conf file, before all other lines beginning with the word ObjectType:

    ObjectType fn=op_objecttype UseOutputStreamSize=8192
    
    
  5. Add the following line before all other lines that begin with the word Service:

    Service type="oracle/proxy" fn="op_service" 
    
    
  6. Start the listener using the GUI or the shell script.

Configuring IIS Listener to Use Proxy Plug-in

This section provides proxy plug-in configuration instructions for the IIS listener on Windows systems. The process involves creating Windows registry entries and using the IIS management console to add directories and filters. You must restart the listener after configuring the plug-in.

To configure the plug-in, follow the steps below:

  1. From the Start menu, select Run.

  2. In the run dialog box, type regedit and click OK.

    The Registry Editor window opens.

  3. In the Registry Editor window, expand the HKEY_LOCAL_MACHINE folder (click on the + preceding its name).

  4. Expand the SOFTWARE folder (click on the + preceding its name).

  5. Click on the ORACLE folder.

  6. From the Edit menu, select New, then Key.

    A new folder is added under the ORACLE folder with the name New Key #1.

  7. Type IIS Proxy Adapter for the key name.

  8. From the Edit menu, select New, then String Value.

    A new value is added in the right window pane with the name New Value #1.

  9. Type server_defs for the value name.

  10. From the Edit menu, select Modify. The Edit String dialog box appears.

  11. In the Value data field, type the full path of your proxy server definition file. Click OK.

  12. Specify log_file and log_level using the procedure specified in steps 8-11. This is optional.

    1. Add a string value with the name log_file and the desired location of the log file (for example, d:\proxy\proxy.log)

    2. Add a string value with the name log_level and a value for the desired log level. Valid values are debug, inform, error and emerg.

  13. Using the IIS management console, add a new virtual directory to your IIS Web site with the same physical path as that of oracle_proxy.dll. Name the directory oproxy and give it execute access.

  14. Using the IIS management console, add oracle_proxy.dll as a filter in your IIS Web site. The name of the filter should be oproxy and its executable must point to the directory containing oracle_proxy.dll (for example, d:\proxy\oracle_proxy.dll).

  15. Restart IIS (stop and then start the IIS Server), ensuring that the osso filter is marked with a green upward arrow.


    Note:

    To restart IIS, you must stop all of the IIS services through the control panel, or restart the computer. This is the only way to ensure that the .dll is reloaded. Restarting IIS through the management console is not sufficient.


Oracle Application Server Proxy Plug-In Usage Notes

This section highlights development and usage practices to consider when developing an application that runs behind the Oracle Application Server Proxy Plug-in. Some of these also have relevance when enabling an application to run behind Oracle Application Server Web Cache.

Troubleshooting

This section describes common problems and possible solutions.

Listener Fails to Start

Listener Returns Incorrect URLs

Changes Made to Proxy Server Definition File are Not Reflected

IIS Listener Displays Incomplete Pages or Garbled Characters

Do not display an IIS pages with a Sun ONE browser.

Parsing Error Occurs with Sun ONE 6.0

If you try to change the ports or turn on security (for SSL), the server may return the error message "Unable to parse magnus.conf".

Remove any comments and added lines preceding and following the Init lines in the magnus.conf file.

"File Not Found" Error Occurs

If you are using a context-based urlrule parameter to retrieve a file that is known to exist, and the listener returns "Not Found", you probably need to set "stripcontext=true".

See Also:

"oproxy.servername.urlrule"

Partial URL Requests Return Unexpected Results

The IIS and Sun ONE servers auto-complete URLs differently. Requests of "http://serviceman", "http://serviceman/", and "http://serviceman/index.html" do not necessarily return the same results on different platforms. The oproxy.servername.urlrule parameter can be used to work around this problem.

See Also:

"oproxy.servername.urlrule"

Sun ONE Server Returns "Server Error" with "/servlet" Request

The default Sun ONE configuration maps any URL requests to "/servlet" to its own servlet handler. You must edit the proxy server definition file, or change the Sun ONE configuration to correct this.

Server Returns Page with Broken Image Links

If you use an exact urlrule parameter, for example, "urlrule=/*.html", in the proxy server definition file (or a similar scenario), the server retrieves the specified page, but all other links are forbidden to the user, including inline images in the page. (If you use an exact urlrule with stripcontext=true, a "Server Error" is returned.)

Unexpected Pages are Displayed

Clear the memory cache in your client browser. Earlier versions of Sun ONE and IE cache pages even when told to retrieve the page every time, when no memory is allocated for caching (you may need to restart the browser to get this behavior to work). If you see a page you're not expecting, try refreshing or reloading the page.

REMOTE_ADDR Contains Unexpected IP Address

The REMOTE_ADDR field usually contains the IP address of the client machine. In some URL request cases, if there is a proxy server in the environment, the field may contain the IP address of the proxy server.

Redirects Go To Network Entry Point

If the back-end server returns a redirect to the entry point of the network, do one of the following, the first option being the preferred one:

SSL Requests Yield Unexpected Results

The proxy plug-in supports SSL connections made between the client and the proxy host, but does not support SSL connections between the proxy and the back-end server. To implement the latter, set up the listener to receive SSL connections and start the back-end server in non-SSL mode. No changes to the proxy configuration are needed.


Go to previous page Go to next page
Oracle
Copyright © 2002, 2003 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index