Oracle
  Home arrow Oracle arrow Page 2 - Understanding Directives and More with...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
Moblin 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ORACLE

Understanding Directives and More with the Oracle HTTP Server
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2007-02-01

    Table of Contents:
  • Understanding Directives and More with the Oracle HTTP Server
  • What Are Block Directives?
  • Merging Containers and Contents
  • Virtual Hosting

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!

    Understanding Directives and More with the Oracle HTTP Server - What Are Block Directives?


    (Page 2 of 4 )

    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


       · This article is an excerpt from the book "Oracle 10g Application Server Exam Guide,"...
     

    Buy this book now. This article is excerpted from chapter five of the book Oracle 10g Application Server Exam Guide, written by Sam Alapati (McGraw-Hill, 2006; ISBN: 0072262710). Check it out today at your favorite bookstore. Buy this book now.

       

    ORACLE ARTICLES

    - Tuning PL/SQL Code
    - Debugging PL/SQL Code
    - Testing PL/SQL Code
    - Working With PL/SQL Code
    - Conditional Compilation for Oracle Database ...
    - Compile-Time Warnings for Oracle DB 10g
    - Compiling PL/SQL Code for an Oracle Database
    - Troubleshooting PL/SQL Code
    - Managing PL/SQL Code
    - Data Manipulation and More for HTML DB Appli...
    - Oracle Database Fundamentals
    - Adding Processes to HTML DB Applications
    - Adding Computations, Processes, and Validati...
    - Sub-templates and More with Oracle HTML DB
    - Focusing on Templates in Oracle HTML DB




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway