Oracle Web Cache Front-Ending Oracle HTTP Server 11g

Oracle Web Cache and Oracle HTTP Server are both part of Oracle Fusion Middleware 11g Web Tier.

<Do not delete this text because it is a placeholder for the generated list of "main" topics when run in a browser>

Purpose

This tutorial covers exercising the Oracle Web Tier Oracle Web Cache as it proxies the Oracle HTTP Server (OHS). No configuration changes should be needed as the default names and addresses are already the proper values for a single host environment.

Time to Complete

Approximately 1/2 hour.

Overview

When a user accesses a Web page, the content can be served by a combination of three sources:

This OBE focuses on the reverse proxy, or Web cache function as it front-ends a Web server. To simplify the environment, the Web pages will be simple static html, eliminating the complexity of an application server being in the mix. If you had more complex pages, that does not change the Web Cache configuration, but might change the Oracle HTTP Server (OHS) configuration (modules). The environment assumes a single host: if you separate Oracle Web Cache from Oracle HTTP Server, then configuration changes will need to be made for the names and addresses of the servers.

Scenario

You have a one-host server with Oracle Fusion Middleware 11g Web Tier installed: Oracle Web Cache and Oracle HTTP Server (OHS). You have Web pages deployed on the OHS, and you want those pages dynamically cached for speed and efficiency, thus reducing network traffic and improving user response time in loading Web pages.

Software and Hardware Requirements

This OBE requires a working Oracle Fusion Middleware 11g Web Tier installation with Enterprise Manager 11g Fusion Middleware Control. In order to do that, the following list of software steps is required:

  1. Install WebLogic Server 11g binaries, but do not run Quickstart, do not create a domain yet.
  2. Install SOA in the WebLogic middleware home in order to get the Java Required Files (JRF). Note: You don't actually use SOA in this OBE.
  3. Run <middleware_home>/<soa_directory>/common/bin/config.sh to create a WebLogic domain. Select Enterprise Manager (EM, which will auto-select JRF as well). Accept the defaults for most everything. Default names will be assumed throughout the OBE.
  4. Start the WebLogic server. You should now be able to log in to EM if you want to verify that EM is working properly.
  5. Run the Web Tier install. Select "Create a Web Tier instance" and "Associate it with your WLS."
  6. Log in to EM. You should see OHS (Oracle HTTP Server) and Web Cache as targets on the Farm home page in EM.
The hardware minimum prerequisites are:

Prerequisites

Before starting this tutorial, you should:

.

Complete OBE "Installing and Configuring Web Tier with WebLogic Server Domain" or equivalent

.

Have write access to the host disk

Exercising Oracle HTTP Server and Web Cache Out-Of-The-Box

The configurations should all be correct by default, all you need to do is to run some Web pages through the proper ports. To test the Web pages, perform the following steps:

.

In a Web browser, go to URL http://yourhostname.com:7001/em where the Oracle Enterprise Manager 11g Fusion Middleware Control is running, and log in with the default User Name of weblogic.

Expand all of the plus [+] icons and verify that all subsystems are up and running.

The Up arrows (^) should be green and all of the slices of the pie charts should be green. Your Host names and addresses may be different. Wherever you see edrsr28p1.us.oracle.com, substitute yourhostname.com as appropriate.

Note that this exercise does not require you to access the WebLogic Server (other than it is used to run the Enterprise Manager 11g FMW Control configuration menus).

 

.

On the left panel, navigate to Farm_base_domain > Web Tier > ohs1. Observe that the Oracle HTTP Server is running, but nothing has been processed.

Ignore the CPU spikes in blue if the management tools are on the same CPU as the OHS server.

 

.

On the left panel, navigate to Farm_base_domain > Web Tier > webcache1. Observe that the Web Cache is running, but nothing has been cached nor served.

Ignore the CPU spikes in blue if the management tools are on the same CPU as the Web Cache server.

 

.

Create a simple sample static Web page and place it in the default directory for Web pages.

Open a text editor in a terminal session. Use gedit or vi or your editor of choice. The file can contain anything. To be interesting, include an image from the /images directory. A sample might look like this:

<html>
 <title> My Junk Web File </title>
  <body>
   <h1> Cool Junk Heading </h1>
    <p> Body of the doc. </p>
    <p> An image goes here: <img alt="oracle" src=images/oracle_logo.png>. </p>  
  </body>
</html> 

Save the file in /u01/app/oracle/product/fmw/11.1.1.1/as_4/instances/instance1/config/OHS/ohs1/htdocs, the default directory for OHS Web pages. Name it something like myjunk.html.

 

.

In a Web browser, test the Web page against OHS directly without going through Web Cache.

Port 7777 is the default for OHS. The default directory path /u01/app/oracle/product/fmw/11.1.1.1/as_4/instances/instance1/config/OHS/ohs1/htdocs is assumed.

 

.

Now try the same page by going through the Web Cache. Click Refresh [circle arrow] several times to cause the objects to be cached.

Port 7785 is the default listen port for the Web Cache. It is mapped from 7785 to the default OHS port of 7777. You can change both ports later if you need to. There are another set of default ports that do the same thing for SSL.

 

.

Observe that the caching statistics show up now. Navigate back to Web Cache > Home.

Obviously this is not a big savings, but it illustrates the concept.

 

.

Show the particular items that were just cached.

Navigate to Web Cache > Monitoring > Popular Requests.

There are many default rules about what is cached and what is not, what is compressed and what is not, and the expiration time for those items. Since .png files are compressed already, there is no point in trying to further compress them. Text (html), on the other other hand, compresses well.

 

Summary

You have just exercised the Oracle Web Cache and the Oracle HTTP Server, both part of the Oracle Fusion Middleware 11g Web Tier. By default, the ports 7785 and 7777 are connected to each other so that requests for Web pages on port 7785 get routed through the Web Cache on to the Oracle HTTP Server on 7777. If you wanted to, you can temporarily defeat the caching by accessing the Web pages on the Oracle HTTP Server directly on port 7777. In many cases involving a single host, the default configuration settings are adequate for an initial demonstration.

In this tutorial, you have learned how to:

Resources

Credits (Optional)