Previous Contents Index Next |
iPlanet Web Server, FastTrack Edition Programmer's Guide |
Chapter 2 Configuration Files
This chapter gives an overview of the iPlanet Web Server's three main configuration files. The sections are:
magnus.conf
For more detailed information about the files magnus.conf, obj.conf, and mime.types, see the NSAPI Programmer's Guide for iPlanet Web Server.You can configure the iPlanet Web Server using the Server Manager interface, or by editing configuration files. The configuration files live in the config directory in the https-server_id directory in the installation directory. For example, if iPlanet Web Server is installed on a Windows NT machine in D:\Netscape\server4\, the configuration files for the server boots.mcom.com are in:
D:\Netscape\server4\https-boots.mcom.com\config
Briefly, the configuration files are:
magnus.conf
The rest of this section discusses the three main configuration files.
obj.conf
- Defines global settings for the server, such as the server name. When the server is initialized, it executes the directives in magnus.conf.
mime.types
- Provides instructions to the server about how to handle requests from clients such as browser. Whenever you make changes to the server through the Server Manager interface, the system automatically edits the obj.conf file. You can also manually edit obj.conf to modify the server behavior.
Other configuration files.
- Defines the MIME types supported by the server. When the server starts up, it loads this file and creates a table that maps file extensions to MIME types, as defined in the file. For example, the extension .html is always mapped to the content type text/HTML.
- Depending on which features are enabled in the server, the config directory contains other configuration files, such as:
- servlets.properties -- defines the servlet properties.
- rules.properties -- defines virtual paths for servlets.
- contexts.properties -- defines the context properties.
- jvm12.conf -- defines Java settings, such as classpaths.
- acl.conf -- defines access control lists.
magnus.conf
The file magnus.conf defines settings that the server uses for initialization. After the server starts up, it does not look in magnus.conf again. This file contains directives that each consist of a variable name and the setting for that variable.
For a complete list of the directives in magnus.conf, see the magnus.conf appendix in the NSAPI Programmer's Guide for iPlanet Web Server.
obj.conf
The obj.conf file contains additional initialization instructions as well as instructions for the server about how to process requests from clients.The normal procedure for modifying the iPlanet Web Server is to use the Server Manager interface. When you use the Server Manager interface to make changes to the iPlanet Web Server, the system automatically updates the obj.conf file.
You can also manually edit obj.conf if desired to add, remove, or modify directives. But if you do so, be sure to load obj.conf into the Server Manager before using the Server Manager to make further changes, otherwise Server Manager overwrites your manual changes.
Each instruction, or directive, in obj.conf, applies during initialization or during a particular stage of the request handling process. The stages are:
Init -- instructions for initialization. These are performed after the server has set the variables defined in magnus.conf.
Each directive in obj.conf invokes a server application function (SAF) and passes arguments to it. For example, the following directive is invoked during the Service stage if the request method is GET and the requested content is of the type text/html. This directive sets the value of the trailer argument to "<H4><FONT COLOR=green>Served by 4.0</FONT></H4>" and passes it to the append-trailer SAF.AuthTrans -- authorization translation.
NameTrans -- translates the logical URI into a local file system path.
PathCheck -- checks the local file system for validity and access permissions.
ObjectType -- determines the MIME type of the requested resource.
Service -- generates the response and returns it to the client.
Service fn=append-trailer method=GET type="text/html" trailer="<H4><FONT COLOR=green>Served by 4.1</FONT></H4>" For more details about obj.conf, about the different stages in the request handling process, and for a list of the pre-defined SAFs you can use in directives, see the NSAPI Programmer's Guide for iPlanet Web Server.
mime.types
When a client, such as a browser, sends a request to the iPlanet Web Server, the MIME type determines the kind of content being requested. The MIME type is usually indicated by the extension of the requested resource. For example, .gif implies the client wants a GIF image, and .html implies the client wants an HTML file.MIME stands for Multipurpose Internet Mail Extension (or Encoding).
The file mime.types maps extensions to MIME types. When the iPlanet Web Server starts up, it loads mime.types and uses it to create a table of mappings between MIME types and extensions.
The ObjectType directives in the file obj.conf give the server instructions on how to determine the MIME type. The catch-all ObjectType directive is:
ObjectType fn="type-by-extension"
The type-by-extension function looks up the MIME type according to the requested resource's extension.
The ObjectType directives set the type parameter. This parameter helps the server determine which Service directive to use to generate the response to send back to the client.
For example, if the request is http://boots/docs/servlet/jos.jsp, this is how the server decides which Service directive to use:
obj.conf contains the directive:
The server also puts the MIME type in the header information to return to the client so that the client knows what kind of content to receive.
In the MIME types table (which is based on mime.types), the server finds:
- ObjectType fn="type-by-extension"
- This tells the server to look up the type in its MIME types table, which is based on the file mime.types.
obj.conf also contains the directive:
- type=magnus-internal/jsp exts=jsp
- This tells the server that the type is magnus-internal/jsp because the extension is jsp.
- Service fn="NSServletService" type="magnus-internal/jsp"
- This tells the server to use the function NSServletService to generate the response.
For more details about the MIME types file and how the server uses it, see the MIME types appendix in the NSAPI Programmer's Guide for iPlanet Web Server.
Previous Contents Index Next
Copyright © 2000 Sun Microsystems, Inc. Some preexisting portions Copyright © 2000 Netscape Communications Corp. All rights reserved.
Last Updated July 13, 2000