 |
|
Overview of the Oracle HTTP Server (OHS)
Oracle Application Server Tips by Burleson
Consulting |
The Oracle HTTP Server (OHS) is built on
Apache version 1.3 and is a very reliable, secure, and capable web
server. OHS (and Apache) is an extremely versatile web server,
capable of handling multiple simultaneous requests in multiple
languages and formats. The Apache base that OHS is built upon
has earned a solid reputation throughout the world for it?s
capabilities and performance.
For the most part, this chapter refers to
the Oracle HTTP Server as OHS, however, many of the actual files
refer to the server as Apache. Because OHS is designed
to be the front end to the application server, there are a number of
additions to the base Apache server and a few features that are not
implemented. An example of this is starting and stopping OHS.
While the Apache server can be started from the command prompt and
can be passed parameters at startup, OHS is normally started and
monitored by the opmnclt script as part of the 9i Application
Server, and the opmn must pass startup parameters to OHS.
Additional Information
This chapter is focused on how to administer
and maintain the Oracle HTTP Server. The best place for
additional information is Oracle HTTP Server Administration Guide.
And since OHS is built on the Apache 1.3 server you can also find
information in the online documentation at
www.apache.org.
Managing the Oracle HTTP Server
In early versions of Oracle9iAS, OHS
(with a standard Apache server) was started and stopped using the
httpd command located in the $ORACLE_HOME/Apache/Apache/bin
directory. Oracle9iAS 9.0.4 uses the apachectl script (located
in the same directory). However, when used, it returns a warning not
to use apachectl, but to instead use the $ORACLE_HOME/dcm/dcmctl
script. The best way to insure that the application server
starts up all parts, including OHS, is to use the $ORACLE_HOME/opmn/bin/opmnctl
script, passing it the startall or stopall parameters. This is
because OHS is an integral part of the application server - stopping
just OHS will cause problems in the instance. Also, opmn
monitors the processes and may restart OHS if it detects it is down.
Thus, it is recommended that the instance be brought down using opmn
if you need to bring down or restart OHS from the command line.
Once running, OHS is easily configured, started or stopped using the
Enterprise Manager web site. Using Enterprise Manager is
discussed later in this chapter.
When OHS starts, it begins as a single
parent process that writes its operating system pid in the file
httpd.pid. The parent process spawns a number of child
processes that are used to handle client requests. As the
server runs, the parent process checks the number of idle child
processes and either adds processes (if there are too few) or
destroys processes (if there are too many) to insure that the server
is ready to respond instantly to a request and is not wasting server
resources with too many idle processes.
When OHS starts, the configuration
information is obtained from a file called httpd.conf, which is
located in the $ORACLE_HOME/Apache/Apache/conf directory. On
an Apache server, this file can be moved and the new location passed
into the server as a startup parameter. Since OHS is started
and monitored by the opmn program, the configuration file should
remain where it was installed.
The httpd.conf file is discussed in detail
later in this chapter. The Apache server that OHS is built on
provides a basic framework and then expands its capabilities by
utilizing modules. This modular structure allows the
administrator to add or remove capabilities to the base server as
needed.
Note: The Distributed Configuration
Management utility maintains a repository of configuration data.
If you manually update the configuration files, you must update the
repository. To execute this update use the command: dcmctl ?updateConfig
?ct ohs. If you update the configuration using Enterprise
Manager the repository is automatically updated for you.
Oracle HTTP Server Modules
The OHS uses modules to add capabilities to
the base server. Some modules are self-contained, while others
rely on separate modules, and some call external programs.
Each module adds features to implement a specific function.
There are nearly 50 core modules in a basic Apache server, while OHS
adds additional modules to support specific 9iAS features.
Each module may add new directives that need
to be defined in the httpd.conf file. The httpd.conf file
contains a number of directives, enclosed within IfModules, that
load parameters only if that module is loaded. Modules are not
actually loaded at startup. OHS scans the module?s file and
loads headers that will call the module if its functionality is
required.
Below is a brief list of some of the main
modules and the functions they add to the basic server. Many
will be discussed in greater detail in the configuration file
section. Because the function of an application server is to support
Enterprise Applications using J2EE, mod_jserv and mod_oc4j are
discussed in detail in Chapters 6 and 7.
Module Type
Module Name
Module Function
Security
mod_access
Access Control based on client host name or
IP
mod_auth
Authentication using text files
mod_auth_anon
Anonymous user authentication
mod_ssl
SSL Certificates
mod_osso
Provides integration with Single Sign On
Configuration
mod_actions
Execution of CGI scripts
mod_alias
Maps directories into the document tree and
URL redirecting
mos_setenvif
Sets environmental variables based on the
request
mod_dir
Supports trailing slash redirects and
directory index files
mod_headers
Supports customization of HTTP response
headers
Debug
mod_log_config
Supports logging of request.
mod_status
Presents current server performance
statistics
Response
mod_mime
Determination of file types from file name
mod_negotiation
Supports selecting the best from multiple
documents that support user?s capabilities
URL_Changes
mod_rewrite
Rule base rewriting engine to rewrite
request on the fly
mod_userdir
Support user_specific directories
Language
mod_perl
Forwards perl scripts to the PERL
interpreter
mod_jserv
Forwards servlet request and handles
response
mod_oc4j
Routes request to OC4J instances, also
supports load balancing.
mod_plsql
Forward plsql request to the Oracle database
engine for execution of stored procedures
mod_include
Server-parsed HTML
mod_CGI
Execution of CGI scripts
Session
mod_unique_id
Supports unique identifiers for certain
request
mod_usertrack
Supports user tracking using cookies
Performance
mod_proxy
Supports caching proxy server
In this chapter and throughout the book some
modules will be discussed in detail. For detailed information
on each module refer to the Oracle HTTP Server Administration Guide.
This is an excerpt from "Oracle
10g Application Server Administration Handbook" by Don Burleson
and John Garmany.