Oracle HTTP Server (OHS) is the Web server component for Oracle Fusion Middleware and the key Web Tier component. It provides a listener for Oracle WebLogic Server and a framework to host static pages, dynamic pages, and applications over the Web.
See Also:For more information on working with OHS, see:
Oracle HTTP Server (OHS) is based on Apache infrastructure and includes Oracle modules that you can use to extend OHS core functionality. Oracle HTTP Server has the following components to handle client requests:
HTTP listener handles incoming requests and routes them to the appropriate processing utility.
Modules (mods) implement and extend OHS functionality. Oracle HTTP Server includes many standard Apache modules. Oracle also includes modules that are specific to OHS to support OHS and OHS component integration.
Oracle HTTP Server can also be a proxy server, both forward and reverse. A reverse proxy enables content served by different servers to appear as if it comes from one server.
Oracle HTTP Server does not require a WebLogic domain but you usually use it with one. Oracle recommends associating OHS with a domain because it enables OHS to be incorporated into the Administration Console, where you can manage and monitor it.
mod_wl_ohs module handles the link to Managed Servers. This module is configured by routing requests of a particular type, such as JSPs, or by routing requests destined to a URL to specific Managed Servers.
Oracle HTTP Server usually front ends a cluster. In this configuration, a special
WebLogicCluster, specifies a comma-separated list of cluster members.
The following steps describe the
mod_wl_ohs directive process:
mod_wl_ohs receives a request for a Managed Server then sends the request to one cluster member in the directive. At least one Managed Server must be available to fulfill the request.
The Managed Server receives the request, processes it, and sends a complete list of cluster members back to
mod_wl_ohs receives the updated list, it dynamically adds previously unknown servers to the known servers list. By doing this, all future requests are load balanced across the cluster member list. The benefit is that new Managed Servers are added to a cluster without updating
mod_wl_ohs or adding OHS.
DynamicServerListcontrols whether or not unknown servers are added to the known servers list. You must set
ONto enable dynamic addition of servers.
Note:When you start, you don't need to include all current Managed Servers in the
mod_wl_ohsdirective. A high availability setup requires only two cluster members in the list for the first call to work. See "Configuring the WebLogic Proxy Plug-In for Oracle HTTP Server" in Oracle Fusion Middleware Using Oracle WebLogic Server Proxy Plug-Ins for more on running an OHS high availability deployment.
See Also:For more information on Oracle WebLogic clusters, see Oracle Fusion Middleware Using Clusters for Oracle WebLogic Server.
After Oracle HTTP Server starts, it is ready to listen for and respond to HTTP(S) requests.
The request processing model is different on Microsoft Windows systems compared to UNIX systems:
For Microsoft Windows, there is one parent process and one child process. The child process creates threads that handle client requests. The number of created threads is static and you can configure them for performance.
For UNIX, there is one parent process that manages multiple child processes. Child processes handle requests. The parent process brings up more child processes as necessary, based on configuration.
See Also:For more information on the OHS processing model, see "Oracle HTTP Server Processing Model" in Administrator's Guide for Oracle HTTP Server.
Use Fusion Middleware Control or the WebLogic Scripting Tool (WLST) to start, stop, and restart Oracle HTTP Server. If you plan to use WLST, you should familiarize yourself with that tool; see "Getting Started Using the Oracle WebLogic Scripting Tool (WLST)" in the Oracle Fusion Middleware Administrator's Guide.
The following figure shows two Oracle HTTP Servers behind a load balancer.
The load balancer receives user requests and forwards them to connected Oracle HTTP Servers. The load balancer receives requests on standard HTTP/HTTPS ports (80/443). However, it then passes requests to Oracle HTTP Servers using completely different ports. Advantages of this setup are:
Actual ports are hidden from users.
Users don't have to add port numbers to the URL.
On UNIX-based systems, starting OHS with root privileges isn't mandatory. Only root can start a process that uses a port less than 1024. However, for processes that use a port number below 1024, you must use root privilege to start a process.
The load balancer routes requests to the functioning Oracle HTTP Servers.
The preceding figure also shows how OHS distributes requests to Managed Servers. For high availability, each pair of components (OHS and Managed Servers) should reside on different host computers. Managed Servers belong to the same cluster; to load balance across a set of Managed Servers, they must belong to the same cluster.
Oracle HTTP Server has two failure types: process failures and node failures. An individual operating system process may fail. A node failure can involve failure of the entire host computer that Oracle HTTP Server (OHS) runs on.
Node Manager protects and manages OHS processes. If an OHS process fails, Node Manager automatically restarts it.
Load balancer in front of OHS sends a request to another OHS if the first one doesn't respond or URL pings indicate it failed.
If a Managed Server in a cluster fails,
Typically, an issue only when using
If client connection failover is configured, in-flight transactions roll back. Database reconnection is required.
If Transparent Application Failover (TAF) is configured, any in-flight database write rolls back but automatic database reconnection occurs and select statements recover automatically. TAF fails over select statements only; package variables are lost. TAF, a JDBC Oracle Call Interface driver feature, enables an application to automatically reconnect to a database if the database instance the connection is made to fails. In this case, active transactions roll back.
If you use the Configuration Wizard to configure Oracle HTTP Server (OHS) and OHS is part of a domain, update the
mod_wl_ohs.conf file for each instance. The file is in the DOMAIN_HOME/
config/fmwconfig/components/OHS/componentName directory. Restart the Administration Server to propagate changes to all OHS instances in the domain, even if they reside on a different host.
See Also:See Section 126.96.36.199, "Configuring mod_wl_ohs.conf" for more information on the
Note:If you install and configure OHS instances in separate domains, you must manually copy changes to other Oracle HTTP servers. You must verify that the changes apply to all OHS instances and that they are synchronized.
This section describes how to configure an example high availability deployment of Oracle HTTP Server (OHS).
This section includes the following topics:
See the following prerequisites before configuring a high availability Oracle HTTP Server deployment.
To distribute requests against Oracle HTTP Servers, you must use an external load balancer to distribute HTTP(S) requests between available Oracle HTTP Servers. If you have an external load balancer, it must have features that Section 2.2.2, "Third-Party Load Balancer Requirements"describes.
In an OHS installation, these virtual servers are configured for HTTP connections, which are distributed across the HTTP servers.
If your site serves requests for HTTP and HTTPS connections, Oracle recommends that HTTPS requests terminate at the load balancer and pass through as HTTP requests. To do this, the load balancer should be able to perform the protocol conversion and must be configured for persistent HTTP sessions.
This example configuration assumes that the load balancer is configured as:
Many Oracle Fusion Middleware components and services use ports. As an administrator, you must know the port numbers that services use and ensure that two services do not use the same port number on your host computer.
Most port numbers are assigned during installation. It is important that any traffic going from the Oracle HTTP Servers to the Oracle WebLogic Servers has access through any firewalls.
To install OHS on WEBHOST1, see the steps in "Installing the Oracle HTTP Server Software" in Oracle Fusion Middleware Installing and Configuring Oracle HTTP Server.
Validate the installation using the following URL to access the OHS home page:
For each virtual host or site name that you use, add an entry to the OHS configuration. Create a file named
virtual_hosts.conf in the ORACLE_HOME/
moduleconf directory as follows:
NameVirtualHost *:7777 <VirtualHost *:7777> ServerName http://myapp.example.com:80 RewriteEngine On RewriteOptions inherit UseCanonicalName On </VirtualHost>
If you are using SSL/SSL Termination (*):
NameVirtualHost *:7777 <VirtualHost *:7777> ServerName https://myapp.example.com:443 RewriteEngine On RewriteOptions inherit UseCanonicalName On </VirtualHost>
Note:You can also use Fusion Middleware Control to create virtual hosts. See "Wiring Components Together" in Oracle Fusion Middleware Administering Oracle Fusion Middleware
After you install and configure Oracle HTTP Server, link it to any defined Managed Servers by editing the
mod_wl_ohs.conf file located in DOMAIN_HOME/
See "Configuring the WebLogic Proxy Plug-In for Oracle HTTP Server" in Oracle Fusion Middleware Using Oracle WebLogic Server Proxy Plug-Ins 12.1.2 for more information on editing the
Note:You can also use Fusion Middleware Control to link OHS to Managed Servers. See "Wiring Components Together" in Oracle Fusion Middleware Administering Oracle Fusion Middleware
The following example shows
LoadModule weblogic_module PRODUCT_HOME/modules/mod_wl_ohs.so <IfModule mod_weblogic.c> WebLogicCluster apphost1.example.com:7050, apphost2.example.com:7050 MatchExpression *.jsp </IfModule> <Location /weblogic> SetHandler weblogic-handler WebLogicCluster apphost1.example.com:7050,apphost2.example.com:7050 DefaultFileName index.jsp </Location> <Location /console> SetHandler weblogic-handler WebLogicCluster apphost1.example.com WebLogicPort 7003 </Location>
These examples show two different ways to route requests to Managed Servers:
<ifModule> block sends any requests ending in *.jsp to the WebLogic Managed Server cluster located on APPHOST1 and APPHOST2.
<Location> block sends any requests with URLs that have a
/weblogic prefix to the Managed Server cluster located on APPHOST1 and APPHOST2.
If you use SSL termination AND route requests to WebLogic, you must take the following additional configuration step:
In the WebLogic console, verify that WebLogic Plugin Enabled is set to true, either at the domain, cluster, or Managed Server level.
Add these lines to the Location block, which directs requests to Managed Servers:
WLProxySSL ON WLProxySSLPassThrough ON
<Location /weblogic> SetHandler weblogic-handler WebLogicCluster apphost1.example.com:7050,apphost2.example.com:7050 WLProxySSL On WLProxySSLPassThrough ON DefaultFileName index.jsp </Location>
After you enable the WebLogic plugin, restart the Administration Server.
To install Oracle HTTP Server on WEBHOST2, see "Installing the Oracle HTTP Server Software" in Oracle Fusion Middleware Installing and Configuring Oracle HTTP Server.
Validate the installation on WEBHOST2 by using the following URL to access the Oracle HTTP Server home page:
To configure and validate the OHS high availability deployment, follow these steps:
mod_wl_ohs.conf file located in DOMAIN_HOME/
config/fmwconfig/components/OHS/componentName directory. You must then restart the Administration Server to propagate changes to all OHS instances in the domain.
Validate the configuration by using the following URLs:
https://myapp.example.com (if using SSL/SSL termination)