Creating a NSAPI filter

About this task

We provide a small file of C code that can be used to ensure that certain files are served by the Web server rather than by the iPlanet Application Server. It uses the NSAPI.

Procedure

  1. Locate the ctrans.c file under debs_home/.
  2. Compile it to a dynamic library.
    For Windows, the compile command is:
    
    cl -LD -MD -DMCC_HTTPD -DXP_WIN32 -DNET_SSL module.c 
    -Insapi\include /link nsapi\examples\libhttpd.lib
    
  3. Add the module to the NameTrans directive in the Web server's obj.conf configuration file as follows:
    1. Find the block where all the Inits are declared. Add line:
      
      Init fn="load-modules" shlib="/container_home/local/nsapi/comergent.so"
       funcs="handle_comergent_static"
      

      Replace the string /container_home/ with the appropriate path.

    2. Find the block:
      
            <Object name="default">
      
    3. Add the line:

      NameTrans fn="handle_comergent_static"

      By default, use the following values for the parameters:

      
            . prefix /NASApp/Comergent/
            . newPrefix /container_home/ias6/ias/APPS/modules/Comergent/
            . list *.css, *.gif, *.js, *.jpg
      

      If you need to override any of the above values, then append them to the “NameTrans” line. For example:

      
            NameTrans fn="handle_comergent_static"
            newPrefix="container_home/ias6/ias/TEST/modules/Comergent/"