Oracle WebServer FAQ

$Date: 10-May-98 $
$Revision: 2.6 $
$Authors: Frank Naudé and Steve Kilbane $

The tangled webs we're weaving

Topics

  • What is the WebServer thing and how does it work?
  • How does one start and stop the Oracle Web Listener?
  • How does one program using the PL/SQL Web Agent?
  • Can one use Designer/2000 to generate Web applications?
  • Can I use a different Web Server from the one included by Oracle?
  • What is the differences between the various Oracle Web Server versions?
  • Should I access Oracle via the CGI interface or the WRB?
  • How to do multi-user updates using the Oracle WebServer?
  • I want to do some more advanced authentication. What are my options?
  • Right, I'm storing userids in a table. How do I encrypt the passwords?
  • Are there alternatives to keeping authentication information in the configuration file?
  • How does one program using the WRB API?
  • Can I store and retrieve images from an Oracle table?
  • How does one use HTTP COOKIEs?
  • Can a Web page be refreshed/reloaded after a given interval?
  • I've lost the Web Server Administrator's password. What can I do?
  • Why do I get "Requested URL was not found on this server"?
  • Why do I get "Request failed. We were unable to process your request at this time"?
  • I've change the permissions of my script, but the Web Server hasn't noticed. Why is this?

  • Back to Oracle FAQ Index

    What is the WebServer thing and how does it work?

    The Oracle WebServer enables users using Web Browsers to access static HTML content and data from Oracle databases (dynamic content).
    +-CLIENT-+                +--------------S E R V E R---------------+
    |        |                |                                        |
    |   Web  | <--Internet--> | Oracle Web <-> Oracle Web <->  Oracle  |
    | Browser|      HTTP      |  Listener      Agent (OWA)    Database |
    |        |                |                                        |
    +--------+                +----------------------------------------+
    
  • Back to top of file

  • How does one start and stop the Oracle Web Listener?

    V1:   wlctl   start <port_number>       eg. wlctl   start 8888
          wlctl   stop  <port_number>
    
    V2.0: wlctl2  start <listener_name>     eg. wlctl2  start admin
          wlctl2  stop  <listener_name>
    
    V2.1: wlctl21 start <listener_name>     eg. wlctl21 start admin
          wlctl21 stop  <listener_name>
    
    V3.0: Starting the webserver (note the sequence):
          owsctl start wrb   ... starts webrequest broker
          owsctl start admin ... start admin listener
          owsctl start yourweb ... start your weblistener
    
          Stopping the webserver (note the sequence):
          owsctl stop yourweb
          owsctl stop admin
          owsctl stop wrb
    
    Note: with V1 one use the 'port number' that your listener is using to "listen" for connections.

  • Back to top of file

  • How does one program using the PL/SQL Web Agent?

    The Oracle Web Agent extends the Common Gateway Interface (CGI) to Oracle PL/SQL stored procedures. Programming is done in PL/SQL using the following set of packaged procedures:
    Example PL/SQL procedure:
    CREATE OR REPLACE PROCEDURE HelloWorld AS
    BEGIN
       htp.htitle('My first dynamic Web page');
       htp.print('Hello world');
       htp.line;
    END HelloWorld;
    /
    To run this example you would typically provide an URL like this to your Web Browser:

    http://your.host.name/oracle_connect_descriptor/owa/HelloWorld

  • Back to top of file

  • How to do multi-user updates using the Oracle WebServer?

    Because the Web is stateless, there is no way to lock data between a SELECT and an UPDATE initiated from a Web Browser. One workaround is to let the procedure that display the data for updating also store the data values in hidden fields. Eg:
       for c1 in (select rowid, a.* from emp a) loop
          htp.FormHidden('the_rowid', c1.rowid);
          htp.Print('Enter new Employee Name:');
          htp.FormHidden('old_ename', c1.ename);
          htp.FormText('new_ename', c1.ename);
       end loop;
    
    The update procedure can now compare the hidden values in the form with the current table values before allowing the update to continue. Eg:
       UPDATE emp SET ename = new_ename
       WHERE rowid = the_rowid
         AND ename = old_ename;
    
       if (SQL%ROWCOUNT = 0) then
          htp.print('Someone else changed this row, please re-query before updating.');
       else
          htp.print('1 row updated.');
       end if;
    

  • Back to top of file

  • Can one use Designer/2000 to generate Web applications?

    Yes, Designer/2000 (CASE) V1.2A and above includes a Web Server Generator that can generate QUERY-ONLY applications.

    From Designer/2000 1.3W one can generate applications that can do Insert, Update and Delete operations. 1.3W also generates JavaScript (NOT JAVA!) code to do client side validation!!!

  • Back to top of file

  • Can I use a different Web Server from the one included by Oracle?

    With the Oracle Web Server version 1.0 you have a CGI-BIN program called OWA that works with any HTTP webserver.

    With version 2.0 you have a CGI-BIN program called OWA that works with any webserver, in addition to a Web Request Broker (WRB) OWA cartridge. The WRB cartridge with 2.0 works with the Oracle Web Server (with 2.0 you can still use the web agent with any server, but you can't use the WRB component with any other server).

    With version 2.1 you have the CGI-BIN program... in addition to a Web Request Broker OWA cartridge. The WRB cartridge with 2.1 works with the Oracle Web Server and/or the Netscape Fasttrack Server.

    With version 3.0 you will have the CGI-BIN program... the cartridge... which works with Oracle Web Server, Netscape fasttrack/enterprise/commerce server, MSIIS, and perhaps others.

  • Back to top of file

  • What is the differences between the various Oracle Web Server versions?

    Feature: v1 v2 v21v3
    PL/SQL via CGI x x x x
    PL/SQL Cartridge  x x x
    Java Cartridge  x x x
    Perl Cartridge    x
    ODBC Cartridge    x
    XA Transaction Management    x
    ICX (Intercartrdige Exchange)    x
    Support Netscape's WEB Server   x x
    Support for MSIIS WEB Server    x

  • Back to top of file

  • Should I access Oracle via the CGI interface or the WRB?

    The Oracle Web Request Broker (WRB) is faster and more scalable than the CGI-BIN program OWA, but can only be used with certain Web servers. CGI programs are spawned off each time a HTTP request is made to it while the WRB will only start new brokers if the workload increase.

    Note that the OWS-BIN OWA program's configuration parameters are stored in the SV*.CFG file while the WRB OWA is configured from SV*.APP.

  • Back to top of file

  • I want to do some more advanced authentication. What are my options?

    Mainly, the best we've come up with is:
  • Back to top of file

  • Right, I'm storing userids in a table. How do I encrypt the passwords?

    Port crypt. :-) More seriously, I don't have an answer for this.

  • Back to top of file

  • Are there alternatives to keeping authentication information in the configuration file?

    One can keep authentication information in a file separate from the sv<server>.cfg file. In this case the following information in the sv<server>.cfg file...
    ************
    [Security]
    Basic {
    (Users)
    users: passwords
    (Groups)
    groups: users   <-----   Single group should not exceed 200 users
    (Realms)
    realms: groups  <-----   Be sure to include all groups
    }
    ;
    [Protection]
    /secret-dir/         Basic(Realm)
    ************
    
         could be replaced with....
    
    ************
    [Security]
    Basic @/path/to/user/authentication/file
    ;
    [Protection]
    /secret-dir/         Basic(Realm)
    ************
    
        The file referred to above should contain the following information...
    
    ************
    (Users)
    users: passwords
    (Groups)
    groups: users   <-----   Single group should not exceed 200 users
    (Realms)
    realms: groups  <-----   Be sure to include all groups
    ************

  • Back to top of file

  • How does one program using the WRB API?

    Download and look at the following working source code example:

    OWA2 is a replacement for the Oracle PL/SQL Web Request Broker Cartridge. Other than Oracle's PL/SQL Cartridge, OWA2 :

    It was written, compiled and tested on a SUN6000E running Solaris 2.5, Oracle 7.3 and the Oracle WebServer V2.0.3. If you make any changes to OWA2 or port it to a different environment, please mail the source code back to me.

    If you find OWA2 useful, PLEASE tell me!!!

  • Back to top of file

  • Can I store and retrieve images from an Oracle table?

    Sure you can, consider the following:

  • Back to top of file

  • How does one use HTTP COOKIEs?

    Cookies allow any site to store information on a WEB Browser's hard disk (cookie.txt file). This information is sent back to the originating site whenever you access it again.

    Look at this code example:

       owa_util.mime_header ('text/html', FALSE);
       owa_cookie.send (cuid, xsession_id, sysdate);
       owa_util.http_header_close;
    
  • Back to top of file

  • I've lost the Web Server Administrator's password. What can I do?

    The Oracle WebServer Administrator's userid and password can be found in your $ORACLE_HOME/ows21/admin/svadmin.cfg file. The password is not encrypted!!!

  • Back to top of file

  • Can a Web page be refreshed/reloaded after a given interval?

    Yes, look at the META tag in the following example:
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=any_valid_url">
    <TITLE>Stay tuned!  3 Seconds until relocation</TITLE>
    ...
    </HTML>
    
    ... or use owa_util.redirect_url.

  • Back to top of file

  • Why do I get "Requested URL was not found on this server"?

    Symptom:
    When attempting to access URLs such as: the server responds with "Requested URL was not found on this server".

    Causes:

    Fix:

  • Back to top of file

  • Why do I get "Request failed. We were unable to process your request at this time. Please try again later"?

    Symptom:
    When attempting to access URLs such as: the server responds with "Request failed. We were unable to process your request at this time. Please try again later."

    Cause:

    Fix:

  • Back to top of file

  • I've change the permissions of my script to make it readable and executable, but the webserver hasn't noticed. Why is this?

    Symptom: webserver doesn't notice file permissions have changed.

    The webserver caches the modification time of the directory, and of all the files within it. If a URL is not available because of permissions problems, and you fix that, the webserver will continue to say that the URL is not available, because the directory modification date hasn't changed, so it doesn't bother to check the file itself. Renaming the file to something and back again will make the webserver see the change. This is configurable, however. On the Web Listener configuration page, there is a parameter which determines how long the Web Server will go without re-scanning a directory that appears to have not changed yet, including the ability to never rescan unless the modification date changes.

  • Back to top of file


  • This is a copy of an article published @ http://www.orafaq.org/