Configuring Net.Data for Use with the Web Server APIs

Using a Web server application programming interface (API) rather than CGI can improve the performance of Net.Data considerably. Net.Data supports the following server APIs:

For more information about each API, see Using the Web Server APIs and the README file for your version of Net.Data.

Requirement: To run Net.Data in GWAPI, ISAPI, or NSAPI mode, you must reconfigure your Web server to use Net.Data DLLs or shared libraries as its service directives. After reconfiguring, you must restart your Web server so that any changes you make to the Net.Data initialization file take effect. By default, Net.Data runs in CGI mode.

The following sections describe how to configure Net.Data and the Web server to run Web server API mode. General steps and examples are provided, but they might differ for your operating system. Refer to the Net.Data README file for your operating system for specific instructions.

To configure GWAPI:

  1. Stop the Web server.
  2. Ensure the GWAPI DLL or shared library is in the server's CGI-BIN or ICAPI-LIB directory.

    See the Net.Data README file or program directory for your operating system for specific file and directory names.

  3. Add a service statement to your Web server's configuration file (httpd.conf or httpd.cnf) to call the API.

    For example:

    Service /cgi-bin/db2www* /home/http/cgi-bin/dtwicapi.o:dtw_icapi*
    

    See the Net.Data README file for your operating system for specific file and directory names.

  4. Restart the Web server.

GWAPI has full compatibility to support existing applications. Use the same methods as you use for CGI to invoke a URL, form, or link with GWAPI. Any macro that executes successfully using CGI will execute successfully using GWAPI. No modifications need to be made to these macros.

To configure ISAPI:

  1. Stop the Web server.
  2. Copy the DLL for ISAPI that comes with Net.Data into the server's subdirectory. For example:
    /inetsrv/scripts/dtwisapi.filetype
    

    Where filetype is .dll for Window NT and OS/2 and .o for UNIX operating systems.

    See the Net.Data README file for your operating system for specific file and directory names.

  3. Because ISAPI bypasses CGI processing, you do not need to have the cgi-bin/db2www/ part of the URL in forms and links. Instead, use dtwisapi.filetype. For example, if the following URL invokes Net.Data as the CGI program:
    http://server1.stl.ibm.com/cgi-bin/db2www/test1.d2w/report
    

    Then you should invoke Net.Data as the ISAPI plug-in with the following URL:

    http://server1.stl.ibm.com/scripts/dtwisapi.dll/test1.d2w/report
    
  4. If you stored your macro test1.d2w in the subdirectory /order/ under one of the directories specified in MACRO_PATH or current directory of the Web server, invoke Net.Data in CGI mode using the following URL:
    http://server1.stl.ibm.com/cgi-bin/db2www/orders/test1.d2w/report
    

    Then the equivalent URL to invoke Net.Data in ISAPI mode is:

    http://server1.stl.ibm.com/scripts/dtwisapi.dll/orders/test1.d2w/report
    
  5. Restart the Web server.

To configure NSAPI:

  1. Stop the Web server.
  2. Copy the DLL for NSAPI that comes with Net.Data into the server directory. For example:
    /netscape/server/bin/httpd/dtwnsapi.filetype
    

    Where filetype is .dll for Window NT and OS/2 and .o for UNIX operating systems.

    See the Net.Data README file for your operating system for specific file and directory names.

  3. Modify your server configuration file with the changes listed below. See the Net.Data README file or program directory for your operating system for operating system differences.
    obj.conf Add to the top of the file:
    Init fn="load-modules" shlib="<path>dtwnsapi.dll" funcs=dtw_nsapi
    
    obj.conf Add to the Services directive:
    Service fn="dtw_nsapi" method=(GET|HEAD|POST)
      type="magnus-internal/d2w"
     
    
    mime.types Add this type, where d2w is the default extension of the macro. You can specify any three-character combination.
    type=magnum-internal/d2w exts=d2w
    
  4. Move the Net.Data macros from the netdata/macro directory to the server's root document directory:
    /netscape/server/docs/
    
  5. Add the server's root document directory to the MACRO_PATH statement, in the initialization file. This change tells Net.Data where to look for the macros.
  6. Because NSAPI bypasses CGI processing, you do not need to have the cgi-bin/db2www/ part of the URL in forms and links. The server knows files with a d2w file type are Net.Data macros because you defined it when you changed the Netscape configuration files. For example, the following URL invokes Net.Data as the CGI program:
    http://server1.stl.ibm.com/cgi-bin/db2www/test1.d2w/report
    

    While the following URL invokes Net.Data as the NSAPI plug-in:

    http://server1.stl.ibm.com/test1.d2w/report
    
  7. Restart the Web server.

If you keep your Net.Data macros in several directories, the last three steps change:

  1. Move the directories with the Net.Data macros they contain to the server's root document directory.
  2. Update the MACRO_PATH variable in the initialization file to include all of the directories and subdirectories where you macros are located.
  3. Modify the links and forms that point to these Net.Data macros, keeping their directory names. For example, when running in CGI mode, the following URL calls a Net.Data macro that is stored in the /orders/ directory:
    http://server1.stl.ibm.com/cgi-bin/db2www/orders/test1.d2w/report
    

    The updated URL used to invoke Net.Data in NSAPI mode is shorter, but keeps the directory name:

    http://server1.stl.ibm.com/orders/test1.d2w/report
    


[ Top of Page | Previous Page | Next Page | Index ]