In this OBE tutorial, you install and
configure the WLS proxy plug-in for an Apache Web server. This proxy
is configured to load balance incoming requests to your existing
cluster. Finally, you verify proper load balancing and failover
by using a supplied JavaEE Web application.
Place the cursor over this icon to load and view all
the screenshots for this tutorial. (Caution: Because this action loads
all screenshots simultaneously, response time may be slow depending on
your Internet connection.)
Alternatively, you can
place the cursor over each individual icon in the following steps to
load and view only the screenshot associated with that step.
Overview
Plug-ins enable WebLogic Server to integrate with
applications deployed on Apache HTTP Server, Netscape Enterprise
Server, or Microsoft’s Internet Information Server. This includes load
balancing HTTP requests across a WebLogic cluster, and automatically
failing over failed requests due to a server not being available. These
plug-ins also integrate with the HTTP session replication features of
WebLogic.
The plug-in for the Apache HTTP Server proxies
requests based on the URL of the request (or a portion of the URL).
This is called proxying by path. You can also proxy requests based on
the Multipurpose Internet Mail Extensions (MIME) type of the requested file. Alternatively, you can use a combination of
the two methods.
Shut down your Apache server if it is running. For
example, on Linux, locate the apachectl script and enter the following command from a shell:
> apachectl stop
This script is typically found under <APACHE_HOME>/bin, where <APACHE_HOME> is the root directory of your Apache installation. Typical values for <APACHE_HOME> on Linux are /usr/local/apache2 or /etc/httpd.
Tip: On most Linux environments, the default
Apache installation can be managed only by the root user.
2.
Follow the instructions here to download an archive containing the WebLogic Apache plug-in. Extract the downloaded archive.
3.
Within the contents of this archive, locate the required plug-in module file, <OS>/<ARCH>/<MODULE>,
where:
<OS> = your operating system, such as Linux
or Windows <ARCH> = your hardware architecture, such as i686
or x86_64 <MODULE> = mod_wl_20.so for Apache 2.0 or mod_wl_22.so
for Apache 2.2
Use Apache to validate your
configuration changes. For
example, on Linux, enter the following command from a shell:
> apachectl configtest
5.
Restart Apache. For
example, on Linux, enter the following command from a shell:
> apachectl start
You can confirm that Apache started
successfully by connecting to it from a Web browser. For example, if Apache is configured to use port 80, use the URL http://localhost.
Direct your Web browser to the browsestore
application, but using Apache:
http://localhost:<APACHE_PORT>/browsestore
<APACHE_PORT> is the port your Apache installation is configured to bind to. For example, if Apache is running on
port 80, use http://localhost/browsestore.
2.
Check the command shells from which you started your managed
servers. Use the output messages to confirm which server the request
was directed to:
"serviced request for the welcome page"
3.
Click the Browse Store link in
the application. Select a category check box and click the Retrieve
Items button.
4.
Once again, check which server each of the prior requests was
routed to:
"serviced the request to browse the store"
"serviced request to print items"
5.
Kill the server that handled the most recent request.
6.
Return to your Web browser, and use the application to select a different category. Apache
should avoid the failed server with no interruption to the client.