HomeOracle Page 3 - Managing the Oracle HTTP Server
Oracle HTTP Server Installation and Configuration - Oracle
Oracle HTTP Server (OHS) takes the Apache Web Server and significantly extends it. This article, the first of a five-part series, introduces you to the server. It is excerpted from chapter five of the book Oracle 10g Application Server Exam Guide, written by Sam Alapati (McGraw-Hill, 2006; ISBN: 0072262710).
By default, Oracle HTTP Server is installed in the $ORACLE_HOME /Apache directory on UNIX and the $ORACLE_HOME /Apache directory on Windows. The Apache directory contains subdirectories for configuring various modules. There's a subdirectory that's also named Apache under the main Apache directory, and this is the base directory of Oracle HTTP Server ($ORACLE_HOME/Apache/Apache). Each of the OHS modules such as mod_oradav, for example, has its own directory under the OHS home directory, which is the $ORACLE_HOME /Apache directory. Here are the important subdirectories under the $ORACLE_HOME/Apache/Apache directory:
bin contains OHS binaries or executables.
cgi-bin contains the CGI scripts that the OHS executes on behalf of various clients. This is the default location for the CGI scripts, but in fact, you can store them anywhere on the server.
logs contains both OHS access logs and the error logs.
conf contains the configuration files.
htdocs contains the HTML scripts. Note that this is also just a default directory from which OHS serves all its static Web documents. Because these are easily accessible by outsiders, you must use alternative locations for storing the Web documents.
on the job: Because the htdocs directory allows access to anyone on the Web, you must keep only publicly available information in this directory.
include contains header files for creating custom modules.
PHP contains sample code for mod_php and the PHP executables.
The main Oracle HTTP Server configuration file is called httpd.conf and is located in the ORACLE_HOME/Apache/Apache/conf directory in UNIX and Linux based systems and the ORACLE_HOME\Apache\Apache\conf directory in a Windows system. You can manually edit the httpd.conf file to reconfigure the HTTP server, but Oracle recommends against your doing so. The preferred method to make configuration changes is by accessing the httpd.conf file using the Application Server Control Console. You must go to the Advanced Server page from the OHS home page and click the httpd.conf file. You can then view and edit the configuration file. Figure 5-1 shows the httpd.conf file in the Application Server Control Console. Note that the httpd.conf is only the main configuration file for OHS. However, you may include pointers to other configuration files such as the oracle_apache.conf file, which is used to load specified Oracle-related modules and is usually included as a file inside the httpd.conf file.
Remember that the recommended way to modify the OHS configuration is through the Application Server Control Console. This way, the metadata repository information will be updated automatically, unlike the case with the manual modification of the httpd.conf file.
Here are some important things to remember about the configuration files:
There's one directive per line.
Directives are case insensitive.
Figure 5-1. The httpd.conf Configuration File
Arguments to the directives are case sensitive.
You can't include comments after a directive, but you can include comments on their own line by prefixing the pound (#) sign.
Any blank lines or white spaces in between lines are ignored.
exam watch: You configure the Oracle HTTP Server with directives.
Other Server Configuration Files
The httpd.conf file, as mentioned, is the primary configuration file for the Oracle HTTP Server. This file contains directives as well as pointers to other configuration files. Here's a brief summary of the other configuration files:
mod_oc4j.conf This file helps you configure the mod_oc4j module, which carries requests from the HTTP Server to OC4J.
mime.types The mime.types file contains extra Internet media types to be sent to clients so they can handle file contents. You can also include the AddType directive in this file.
oracle_apache.conf This is the main file for storing configuration files of all supported modules such as moddav and plsql . Here are the typical contents of the oracle_apache.conf file:
# Advanced Queuing-AQ XML include "C:\OraHome_2\rdbms\demo\aqxml.conf" # Directives needed for OraDAV module include "C:\OraHome_2\Apache\oradav\conf\moddav.conf" include "C:\OraHome_2\Apache\jsp\conf\ojsp.conf" include "C:\OraHome_2\Apache\modplsql\conf\plsql.conf" # Oracle uix include "C:\OraHome_2\uix\uix.conf" #OiD DAS module include "C:\OraHome_2\ldap\das\oiddas.conf" #Directives needed for SSO module include "C:\OraHome_2\sso\conf\sso_apache.conf" #Directives needed for OCM module include "C:\OraHome_2\Apache\Apache\conf\ocm_apache.conf"
Note that some of the minor configuration files can be read each time a related file or directory is requested by a client. Some files, on the other hand, are read only once, when the OHS instance is started. These files, like the main configuration file httpd.conf file, are called server-wide configuration files.