Oracle
  Home arrow Oracle arrow Page 2 - Directives, Access, and More with the ...
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 
Moblin 
JMSL Numerical Library 
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

Directives, Access, 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 / 3
    2007-02-08

    Table of Contents:
  • Directives, Access, and More with the Oracle HTTP Server
  • Directory Indexing
  • Using Aliases
  • Access Restriction Directives
  • Obtaining the HTTP Server Status

  • 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


    Directives, Access, and More with the Oracle HTTP Server - Directory Indexing


    (Page 2 of 5 )

    As you have learned, Indexes is one of the parameters you can use with the Options directive. You use the Indexes option to tell the HTTP Server whether it should produce an HTML page when a directory is requested. You add indexes to the list of options in this way:

      Options +Indexes

    You have several options when a user requests a directory rather than a file:

    • The HTTP Server can return a default file: You can use the DirectoryIndex directive, which follows, to specify the default file:

      DirectoryIndex index.html index.htm

      In the foregoing example, the server will first try to return the index.html and then the index.htm file.
    • An HTML page of the directory contents can be generated and sent back
    • A "permission denied" error can be issued
    • A "file not found" error can be issued, as shown here:

      DirectoryIndex index.html /cgi-bin/error404.cgi

    If you enable Indexes and none of the resources specified with the DirectoryIndex directive are found, by default the HTTP Server will generate an index of the directory. To avoid this default behavior, you must specify a non-relative URL as the (last) option for the DirectoryIndex directive, as illustrated in the preceding example.

    Directory Listings

    You may not want all users to have access to backup files and files such as the .profile and the .cshrc files. To prevent all files from showing up in file listings, you use the IndexIgnore directive. Any files you specify as options for the IndexIgnore directive will not appear in file listings. Heres a simple example:

      IndexIgnore .??* *~ *# *.bak HEADER* README*

    The following are the results of using the IndexIgnore directive in the above manner:

    • All backup, header, and readme files are not listed.
    • Any filename that starts with a dot and is longer than three characters is ignored.

    on the job:  Once you eliminate a file from being listed, through the IndexIgnore directive, that file can no longer be reinstated as part of a file listing.

    Response Handling

    When the Oracle HTTP Server encounters an error while processing a user's request, it first logs the error in the error_log file and then sends an error message to the client. Using the ErrorDocument directive, you can customize the Oracle HTTP Server's response in the form of an HTML document.

    When the Oracle HTTP Server encounters an error, it can do one of the following four things:

    • Send a simple hard coded message.
    • Send a custom message.
    • Redirect to a local URL-path.
    • Redirect to an external URL.

    By default, the Oracle HTTP Server will choose option 1 when it encounters errors. Since this means that the user will get an ugly error message, you must choose one of the options and customize the response of the Web server to error conditions. You can use the ErrorDocument directive to configure one of the other three options. You can specify an HTTP error-response code and a URL or a message when you use the ErrorDocument directive. Local URL paths start with a slash (/) relative to the DocumentRoot, or a full URL, if it's external. The HTTP Server can also provide a message to be displayed by the browser. Here are some examples:

      ErrorDocument 500 http://foo.example.com/cgi-bin/tester 
      ErrorDocument 404 /cgi-bin/bad_urls.pl
      ErrorDocument 401 /subscription_info.html
      ErrorDocument 403 "Sorry can't allow you access today"

    You can also use the special value default, to specify the simple hardcode message by the HTTP Server, as shown here. Doing this will ensure that the simple hardcoded message will be restored, instead of inheriting an existing ErrorDocument value.

      ErrorDocument 404 /cgi-bin/bad_urls.pl
      <Directory /web/docs>
      ErrorDocument 404 default
      </Directory>

    Expires Header

    The Expires header in a document determines when a document becomes out of date. Using the ExpireActive directive, you can turn the sending of the Expires header on and off.

    on the job:  Themod_expires module controls the Expires header.

    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

    - Implementing and Using Oracle`s Restore Poin...
    - 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





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