Blogs about Deep Learning, Machine Learning, AI, NLP, Security, Oracle Traffic Director,Oracle iPlanet WebServer

  • October 24, 2008

Understanding Oralce iPlanet/Sun Java System Web Server 7.0 - for developers

Here are things a developer working on Oracle Iplanet Web Server 7.0 or writing a NSAPI plugin should know  

The latest Oracle iPlanet Web Server(formerly known as Sun Java System Web Server) 7.0 latest update download location : http://www.oracle.com/technetwork/java/webtier/downloads/index.html

The latest Sun Java System Web Server 7.0 update 9 documentation : http://download.oracle.com/docs/cd/E18958_01/index.htm

Bookmark NSAPI configuration guide :
and Administrator's Configuration File
Reference http://docs.sun.com/app/docs/doc/820-4841 (which has

Some examples on how to write a plugin for Oracle iPlanet Web Server 7.0

<ws-install-dir>/samples/nsapi has some examples about how to write a custom plugin.

Let me start by explaining the basics of our Web Server first in this blog 

To add your own .so dynamic library 

In magnus.conf configuration file we can load our own .so's  as shown below :

#cat magnus.conf

Init fn="load-modules" shlib="libj2eeplugin.so"

Different request and response processing stages in Oralce iPlanet Web Server 7.0

In Sun Java System Web Server 7.0 there are different stages AuthTrans, NameTrans, PathCheck, ObjectType, Service, Output, Input, Error as given in obj.conf.  More info in
http://docs.sun.com/app/docs/doc/820-4841/abvag?a=view . We can even make
own function that can be executed in a different stages and add it here
in this file.

cat obj.conf
<Object name="default">
AuthTrans fn="match-browser" browser="\*MSIE\*"

NameTrans fn="ntrans-j2ee" name="j2ee"
NameTrans fn="pfx2dir" from="/mc-icons"

PathCheck fn="uri-clean"
PathCheck fn="check-acl" acl="default"
PathCheck fn="find-pathinfo"
PathCheck fn="find-index-j2ee"
PathCheck fn="find-index"

ObjectType fn="type-j2ee"
ObjectType fn="type-by-extension"
ObjectType fn="force-type" type="text/plain"
Service method="(GET|HEAD)" type="magnus-internal/directory"

Service method="(GET|HEAD|POST)" type="\*~magnus-internal/\*"

Service method="TRACE" fn="service-trace"
Error fn="error-j2ee"
AddLog fn="flex-log"

<Object name="j2ee">
Service fn="service-j2ee" method="\*"

<Object name="compress-on-demand">
Output fn="insert-filter" filter="http-compression"


In Web Server we can insert filters like NSPR I/O layer. Filters enable
functions to intercept and possibly
modify data sent to and from the server. More info is in :
http://docs.sun.com/app/docs/doc/820-4843/abvek?a=view . There are two
types of filters Input and Output.

Some important Structures in Oracle iPlanet Web Server 7.0

Sun Java System Web Server 7.0 has Request
http://docs.sun.com/app/docs/doc/820-4843/abvmz?l=en&a=view . It has 4 pblock s which stores data in key and
value pairs. More information is given in http://docs.sun.com/app/docs/doc/820-4843/abvmv?l=en&a=view

typedef struct{
\*/Server working variables \*/
pblock \*vars;
/\* The method, URI, and protocol revision of this request \*/
pblock \*reqpb;
/\* Protocol specific headers \*/
int loadhdrs;
pblock \*headers;
/\* Server's response headers \*/
int senthdrs;
pblock \*srvhdrs;
/\* The object set constructed to fulfill this request \*/
httpd_objset \*os;
} Request;

We can print these pblocks by INTpblock_pblock2str(rq-><pblockname>, NULL);. All request
headers will be parsed and put into headers pblock. Response
headers will be put into srvhdrs pblock.

Memory Management

request has its own memory pool which gets freed automatically. So we
should call MALLOC , FREE, STRDUP etc. rather than malloc, free, and

Join the discussion

Comments ( 2 )
  • Baskar Friday, March 11, 2011


    Could you please explain what are AuthTrans, NameTrans, PathCheck, ObjectType, Service, Output, Input, Error in obj.conf ?

    Also, explain their functionalities.



  • Meena Friday, March 11, 2011

    What is it you are trying to achieve. You can ask questions in forum


    Its is in NSAPI Programmers guide :


    After the client sends its request to a server, it is helpful to define a set of logical steps which the server must perform before a response is sent.

    The following steps are performed in the normal response process:

    \* Authorization translation

    \* Name translation

    \* Path checks

    \* Object type

    \* Respond to request

    \* Log the transaction

    If at any time one of these steps fail, another step must be performed to handle the error and inform the client about what happened.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.