Installing the Apache-WebLogic Server Plug-in
Configuring the httpd.conf file
Parameters for the Apache-to-Weblogic Bridge
Deploying the WebLogic-to-Apache Bridge
Overview
This document describes how to install and configure the Apache-WebLogic Sever plug-in. The plug-in allows a smooth integration of WebLogic Server's HTTP functionality into the Apache Server. Using the Apache-WebLogic Sever plug-in enhances an existing Apache installation by providing a way to access WebLogic Server's servlet engine transparently.
The plug-in is intended for use in an environment where an Apache Server serves static pages, and another part of the document tree (dynamic pages best generated by HTTP Servlets) is delegated to a WebLogic Server operating in a different process, possibly on a different host. To the end user - the browser - the HTTP requests delegated to WebLogic Server still appear to be coming from the same source; WebLogic Server on the back-end is invisible. The HTTP-tunneling facility of the WebLogic Server client-server protocol may also operate through the plug-in, providing access to all WebLogic Server services, not only HTTP servlets.
The Apache-WebLogic Sever plug-in operates as an Apache module within an Apache Server. An Apache module is loaded by an Apache Server at startup, and then certain HTTP requests are delegated to it. Apache modules are similar to HTTP (Java) servlets, except that an Apache module is in code native to the platform. The Apache plug-in has been tested and is intended for use with Apache Server 1.3.9.
Installing the library
The Apache plug-in is distributed as a shared object (.so) for use on Solaris platforms. These files are located in the weblogic/lib directory.
The .so for Solaris is shipped in the weblogic/lib/solaris directory as the file
mod_wl.so.
The Apache plug-in is installed as an Apache DSO (Dynamic Shared Object). DSO support in Apache is based on a module named mod_so.c which needs to be enabled before mod_wl.so is loaded. If you installed Apache with the supplied script for Solaris, or with the Windows NT installshield, mod_so.c should be enabled. To be certain that mod_so.c is enabled, run:
APACHE_HOME/conf/httpd -l
This command lists all of the enabled modules, if mod_so.c is listed, follow the 6 numbered steps at the end of this section. If mod_so.c is not listed, follow the instructions included with the distribution of Apache to manually configure Apache with the following parameters:
/configure --prefix=<destination directory>
--enable-module=so
--enable-rule=SHARED_CORE
Continue following the Apache installation instructions to make and install the product.
After Apache installation is complete with the mod_so.c enabled. The Apache plug-in is installed with a support program named apxs (APache eXtenSion) that builds DSO based modules outside of the Apache source tree, and will add the AddModule mod_so.c line to the httpd.conf file. To install the Apache-WebLogic Sever plug-in follow these 6 steps:
APACHE_HOME/bin/apxs -i -a -n weblogic mod_wl.so
LoadModule weblogic_module
AddModule mod_weblogic.c
APACHE_HOME/bin/apachect1 start
Configuring the httpd.conf file
After you install the libraries, you will need to modify the httpd.conf file to configure the Apache plug-in. Modifying the httpd.conf file informs the Apache web server that it should load the native library for the plug-in as an Apache module, and also describes exactly which requests should be handled by the module. The correct file for Apache will be located in APACHE_HOME/conf/httpd.conf (where APACHE_HOME is the root directory of Apache installation).
To set up the WebLogic Apache plug-in on Apache, you will need the following information in the httpd.conf file:
LoadModule weblogic_module libexec/mod_wl.so
AddModule mod_weblogic.c
If you choose to proxy by URL, the location block and SetHandler will be used. SetHandler specifies the handler for the Weblogic module as shown below.
<Location URL>
SetHandler weblogic-handler
</Location>
<Location /weblogic>
SetHandler weblogic-handler
</Location>
<Location /servletimages>
SetHandler weblogic-handler
</Location>
In this manner, URLs directed to Apache at the specified location will be passed to the WebLogic Server for parsing. Because the PathTrim has been set to strip /weblogic from the URL, the URL forwarded to the WebLogic Server will be:
http://myenterprise.server.com:7001
Note, the Apache-WebLogic Server plug-in can not be configured to proxy requests to multiple WebLogic Clusters. Requests that match any of the URLs specified in the location blocks will be forwarded to the same cluster.
Proxy by MIME file type
To proxy by MIME file extension type, you must place an identifier of the selected MIME type to the mime.types file in your configuration directory. For example, the JSP MIME type can be selected as follows:
<Files *.jsp>
SetHandler weblogic-handler
</Files>
Parameters for the Apache-Weblogic Server Plug-in
The Weblogic Module for Apache recognizes the following parameters. To modify the properties of your Apache-WebLogic Sever plug-in, these parameters can be placed in the IfModule or a Weblogic.conf file that is included in the IfModule.
<IfModule mod_weblogic.c>
# Config file for Weblogic which defines the parameters
Include conf/weblogic.conf
</IfModule>
<IfModule mod_weblogic.c>
# define your parameters here.
</IfModule>
Please note that each parameter should go in a new line, and there should not be an `=' between the parameter and its value. For Example:
PARAM_1 value1
PARAM_2 value2
PARAM_3 value3
WebLogicCluster myweblogic.com:7001,
yourweblogic.com:6999,theirweblogic.com:6001
Sample httpd.conf file
Below is an example httpd.conf file. You can use this example as a template that you can modify to suit your environment and server. Lines beginning with # are comments. Please note that Apache is not case sensitive, and that the LoadModule and AddModule lines will be automatically added by the apxs utility.
############################################
APACHE-HOME/conf/httpd.conf file
############################################
LoadModule weblogic_module libexec/mod_wl.so
##### Weblogic specific declarations ########
<Location /weblogic>
SetHandler weblogic-handler
PathTrim weblogic
# or you can set PathTrim to /weblogic
ErrorPage http://myerrorpage1.mydomain.com
</Location>
<Location /servletimages>
SetHandler weblogic-handler
Pathtrim something
ErrorPage http://myerrorpage1.mydomain.com
</Location>
<Files *.jsp>
SetHandler weblogic-handler
</Files>
################## Parameters ####################
<IfModule mod/weblogic.c>
Include conf/weblogic.conf
</IfModule>
############# End of WebLogic specific declarations #######
AddModule mod_weblogic.c
Sample weblogic.conf files
Instead of defining Weblogic Parameters in the location block of your httpd.conf file, if you prefer, you can use a weblogic.conf file that is loaded by the IfModule in the httpd.conf file. Either of the following examples may be used as templates that you can modify to suit your environment and server. Lines beginning with `#' are comments.
Example using WebLogic Clusters
####################################################
APACHE>HOME/conf/httpd.conf file
### Example using WebLogic Clusters ####
####################################################
# These parameters are common for all URLs which are
# directed to the current module.
WebLogicCluster w1s1.com:7001,w1s2.com:7001,w1s3.com:7001
# note that the default PathTrim is also "weblogic"
PathTrim weblogic
ErrorPage http://myerrorpage.mydomain.com
# Note: If you want to override these parameters for each URL,
# you can set them again in the <Location> or <Files> blocks
####################################################
Example without WebLogic Clusters
####################################################
APACHE>HOME/conf/httpd.conf file
### Example without WebLogic Clusters ####
####################################################
# These parameters are common for all URLs
# which are directed to the current module.
WebLogicHost myweblogic.server.com
WebLogicPort 7001
PathTrim weblogic
# Note: If you want to override these parameters for each URL,
# you can set them again in the <Location> or <Files> blocks
####################################################
Deploying the Apache-WebLogic Server plug-in
Once you have installed and configured the Apache-WebLogic Sever plug-in, follow these steps for deployment and testing:
http://myenterprise.server.com/weblogic/
|
Copyright © 2000 BEA Systems, Inc. All rights reserved.
|