Web Development


Appendix C. Setting Up an NSAPI Web Server

Panther web applications support NSAPI for HTTP processes.


Configuring Your NSAPI-Compliant Server

In the following instructions, the HTTP server is installed at /usr/netscape/suitespot, and the cgi-bin directory is /usr/netscape/suitespot/cgi-bin/.

In order to install Panther NSAPI support:

  1. Copy prlldr.nsa to /usr/netscape/suitespot/cgi-bin/.
  2. Modify the file /usr/netscape/suitespot/http*/config/obj.conf as follows:
  3. At the top of the file, add:
    Init fn="load-modules" \
    shlib="/usr/netscape/suitespot/cgi-bin/prlldr.nsa" \
    funcs="prolifics,prolifics-init"
    Init fn="prolifics-init"
  4. After the line <Object name=default>, add the following preceding any line similar to NameTrans fn="pfx2dir" ... from="/":
    NameTrans fn="pfx2dir" \
    from="/prolifics"\
    dir="/usr/netscape/suitespot/cgi-bin" \
    name="prolifics"
  5. After the line </Object>, add:
    <Object name=prolifics>
    ObjectType fn=force-type type=magnus-internal/prolifics
    Service fn=prolifics
    </Object>
  6. The file /usr/netscape/suitespot/http*/config/mime.types must also be modified. After the line type=magnus-internal/cgi exts=cgi,exe,bat, add:
    type=magnus-internal/prolifics exts=nsa
  7. After the edits are complete, restart your Netscape server.

Accessing the Panther Web Application

To access the Panther web application using NSAPI:


A Sample Obj.conf File

The following obj.conf file illustrates the edits detailed in the previous section.

Init fn="load-modules" \
shlib="/usr/netscape/suitespot/cgi-bin/prlldr.nsa" \
funcs="prolifics,prolifics-init"
Init fn="prolifics-init"
Init fn=flex-init access="/usr/netscape/suitespot/https-myserver/logs/access" format.access="%Ses->client.ip% - %Req->vars.auth-user% [%SYSDATE%] \"%Req->reqpb.clf-request%\" %Req->srvhdrs.clf-status% %Req->srvhdrs.content-length%"
Init fn=load-types mime-types=mime.types
<Object name=default> 
# the following directive must precede any line similar to
# NameTrans fn="pfx2dir" ... from="/"
NameTrans fn="pfx2dir" \
from="/prolifics" \
dir="/usr/netscape/suitespot/cgi-bin" \
name="prolifics"
NameTrans fn=pfx2dir from=/ns-icons dir="/usr/netscape/suitespot/ns-icons"
NameTrans fn=pfx2dir from=/mc-icons dir="/usr/netscape/suitespot/ns-icons"
NameTrans fn="pfx2dir" from="/help" dir="/usr/netscape/suitespot/manual/https/ug"
NameTrans fn=document-root root="/usr/netscape/suitespot/docs"
PathCheck fn=unix-uri-clean
PathCheck fn="check-acl" acl="default"
PathCheck fn=find-pathinfo
PathCheck fn=find-index index-names="index.html,home.html"
ObjectType fn=type-by-extension
ObjectType fn=force-type type=text/plain
Service method=(GET|HEAD) type=magnus-internal/imagemap fn=imagemap
Service method=(GET|HEAD) type=magnus-internal/directory fn=index-common
Service method=(GET|HEAD) type=*~magnus-internal/* fn=send-file
AddLog fn=flex-log name="access"
</Object>
<Object name=prolifics>
ObjectType fn=force-type type=magnus-internal/prolifics
Service fn=prolifics
</Object>
<Object name=cgi>
ObjectType fn=force-type type=magnus-internal/cgi
Service fn=send-cgi
/Object>