Home arrow Oracle arrow Page 2 - Understanding Directives and More with the Oracle HTTP Server

What Are Block Directives? - Oracle

In this fourth article in a five-part series, you'll learn about block directives, virtual hosting, and more as they apply to the Oracle HTTP Server (OHS). It is excerpted from chapter five of the book Oracle 10g Application Server Exam Guide, written by Sam Alapati (McGraw-Hill, 2006; ISBN: 0072262710).

TABLE OF CONTENTS:
  1. Understanding Directives and More with the Oracle HTTP Server
  2. What Are Block Directives?
  3. Merging Containers and Contents
  4. Virtual Hosting
By: McGraw-Hill/Osborne
Rating: starstarstarstarstar / 4
February 01, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

A block directive specifies conditions under which the directive will take effect. Thus, block directives aren't scope based, but rather depend on whether the HTTP Server will take its directives into account when starting up, based on some condition holding true or false. You can use block directives to limit directives to work only on certain virtual hosts, directories, or files. There are two block directives: <IfModule> and <IfDefine>.

<IfModule>

You use the <IfModule> directive to mark those directives that are processed only if a certain module is present and is available in the OHS server. The stated module can be made available to OHS in either of two ways. It can be statically compiled into the OHS server, or you must make the module dynamically available by compiling the module and placing a LoadModule line in the httpd.conf file. The LoadModule line must appear before the <IfModule> directive.

Here’s an example using the <IfModule> directive that comes into effect only for the mod_user_dir.c module:

  <IfModule mod_userdir.c>
  UserDir public_html
  </IfModule>

Any URL whose path starts with a tilde would be mapped to UserDir, provided the mod_userdir.c module exists. Otherwise, the <IfModule> directive has no effect.

<IfDefine>

As you're probably aware, in the Apache HyperText Transfer Protocol (HTTP) server program, the httpd daemon, when run as a standalone process, creates child processes or threads to handle user service requests. You normally don't invoke the httpd daemon directly, but rather do so through using the apachectl utility on Apache systems, and the opmnctl utility in Oracle HTTP Server.

The directives within an <IfDefine> section are processed only if the enclosed test is evaluated to be true; otherwise, everything between the two
<IfDefine> section markers is ignored. The <IfDefine> directive uses the parameter-name argument given on the httpd command line via the -D parameter. Note that the <IfDefine>directive is thus used for conditionally processing directives, based on the evaluation of the conditions that prevail when the OHS server is started. OHS will apply the directives within the <IfDefine> directive only if the stated parameter
is defined on the httpd command line. In the following example, requests will be redirected to alternative sites only if you start the OHS server with the httpd
--DclosedForNow option.

  <IfDefine ClosedForNow>
  Redirect /
http://otherserver.example.com/
  </IfDefine>

By using the parameter-name specification, you can reverse the test and process directives within the <IfDefine> sections if the parameter name isn't
defined.

Note that containers can't include other containers, with the exception of the Limit directive and the Files container. You can include a Files container in a
Directory container. You can place any directive inside a Limit or LimitExcept container, as long as the Limit or LimitExcept directive is placed within a container that conforms to these directives. You can include all the other container types inside a <VirtualHost> container.



 
 
>>> More Oracle Articles          >>> More By McGraw-Hill/Osborne
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

ORACLE ARTICLES

- Oracle Java Security Woes Continue
- Oracle's New IaaS Cloud Option: There's a Ca...
- Oracle Acquires Eloqua to Boost Cloud Presen...
- Choosing Innovation: Oracle Survey Insights
- Oracle Fixes Privilege Escalation Bug
- Oracle`s Communications Service Availability...
- Oracle Releases Exalytics, Taleo Plans
- Oracle Releases Communications Network Integ...
- Oracle Releases Communications Data Model 11...
- Oracle Releases PeopleSoft PeopleTools 8.52
- Oracle Integrates Cloudera Apache Distro, My...
- Oracle Releases MySQL 5.5.18
- Oracle Announces NoSQL Database Availability
- Sorting Database Columns With the SELECT Sta...
- Retrieving Table Data with the LIKE Operator

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: