NoteThe configuration information stored in the Registry in the version 1.1 Web servers is now stored in the configuration files. You might need to manually configure the server for various reasons. If you accidentally lock your hosts out of the administrative forms or if you forget your administrative password, you'll have to manually change information in the server's configuration files.
Before you can edit any of the configuration files, you must have permission to read and write to the files. This probably means you need to log in as root.The magnus.conf, obj.conf, and mime.types files are kept in the config directory in your server root directory; the admpw file is in the admserv directory in your server root directory.
magnus.conf
is the server's main technical configuration file. It controls aspects of the server operation not related to documents, such as host name and port.
obj.conf
is the server's object configuration file. It controls access to the server and manages the files and directories the server can send to clients.
mime.types
is the file the server uses to convert file-name extensions such as .GIF into a MIME type like image/gif.
admpw
is the administrative password file. Its format is user:password. The password is DES-encrypted, like /etc/passwd.
Comment lines begin with a # character with no leading white space.Directive lines can contain white space at the beginning of the line and between the directive and value, but trailing white space after the value might confuse the server. Long lines can be continued with a backslash (\) character before the linefeed.
Caution!If you are using the Administration forms, you shouldn't use continuation lines in the magnus.conf file. Instead, put each Init configuration entirely on a single line. If you are absolutely sure you will never use the Administration form, you can use the backslash character.
# Sample magnus.conf file for Netscape server 2.0
# The server's home--its root directory
ServerRoot /usr/ns-home/https-server1
# The server's name
ServerName www.netscape.com
# Which port?
Port 443
# This tells the server to get its objects from obj.conf, and use
# the "default" object as the default.
LoadObjects obj.conf
RootObject default
# The logfile for errors, and the file where it should keep
# the pid of the master server process.
ErrorLog /usr/ns-home/https-server1/logs/errors
PidLog /usr/ns-home/https-server1/logs/pid
# Which user should the server run as? This is the UNIX user
# account name.
User http
# Processes - number of processes to spawn
MaxProcs 1
MinThreads 4
MaxThreads 128
# Use DNS? (turn this off for performance reasons)
DNS on
# Security directives: is security on, where is my keyfile,
# which ciphers should I support (Ciphers directive is on the
# US version only)
Security on
Keyfile ServerKey.der
Certfile ServerCert.der
Ciphers +rc4, +des, +rc4export
SYNTAXServerName host host is a fully qualified domain name such as myhost.netscape.com.
DEFAULTIf ServerName isn't in magnus.conf, the server attempts to derive a host name through system calls. If they don't return a qualified domain name (for example, it gets
myhost
instead of myhost.netscape.com
), the server won't start, and you'll get a message telling you to manually set this value.
EXAMPLES
ServerName server.netscape.com
ServerName www.server.anycompany.com
ServerName www.agency.gov
NoteThe port you choose can affect how users configure their navigators. Users must specify the port number when accessing the server if the port number is anything other than 80 or 443.
SYNTAXPort number number is a whole number between 0 and 65535.
DEFAULTIf no port is specified, the server assumes 80.
EXAMPLES
Port 80
Port 8080
Port 8000
SYNTAXUser name name is the 8-character (or less) login name for the UNIX user account.
DEFAULTIf there is no User directive, the server runs with the user account it was started with. If the server was started as root or superuser, you'll see a warning message after startup.
EXAMPLES
User http
User server
User nobody
SYNTAX
MaxProcs number
number is a whole number between 1 and the size of your system's process table.
DEFAULT
MaxProcs 50
EXAMPLES
MaxProcs 20
MaxProcs 40
MaxProcs 80
MinThreads
sets the minimum number of threads the server can have active.
Choose a number that is appropriate for the type of access you expect for the server. If this number is too small, clients will experience delays. If the number is too large, you might run out of memory
SYNTAX
MinThreads number
number is a whole number between 1 and
number is a whole number between 1 and
DEFAULT
MinThreads 4
EXAMPLES
MinThreads 6
MinThreads 8
SYNTAXErrorLog logfile
logfile
can be either a full path and file name or the keyword SYSLOG
(it must be in all capital letters).
DEFAULTThere is no default error log.
EXAMPLES
ErrorLog /var/ns-server/logs/errors
ErrorLog SYSLOG
logs/pid
.
To shut down your server, kill the base server process listed in the pid log file by using a -TERM
signal. To tell your server to reread its configuration files and reopen its log files, use kill with the -HUP
signal.
If the PidLog file isn't writable by the user account that the server uses, the server does not log its process ID anywhere. The server won't start if it can't log the process ID.
SYNTAX
PidLog file
file
is the full pathname and filename where the process ID is stored.
DEFAULTThere is no default.
EXAMPLES
PidLog /var/ns-server/logs/pid
PidLog /tmp/ns-server.pid
NoteAlthough you can have more than one object configuration file, the server's Administration forms only work with one file and assume that it is in the server root in config/obj.conf. If you use the Administration forms (or plan to), don't put the obj.conf file in any other directory and don't rename it.
SYNTAXLoadObjects filename filename is either the full pathname or a relative pathname. Relative pathnames are resolved from the directory specified with the -d command line flag. If no -d flag was given, the server looks in the current directory.
DEFAULTThere is no default.
EXAMPLES
LoadObjects obj.conf
LoadObjects /var/ns-server/admin/config/local-objs.conf
SYNTAXRootObject name name is the name of an object defined in one of the object files loaded with a LoadObjects directive.
DEFAULTThere is no default.
EXAMPLES
RootObject default
RootObject server1
perl or /bin/sh
) must be copied to the Chroot directory.
The user public information directory feature isn't available unless a copy of /etc/passwd
is kept in the Chroot directory and all of the users home directories are exactly mirrored within the Chroot directory.
A server using Chroot can't be restarted with the -HUP
signal.
Logs and server configuration files should be kept outside the Chroot directory.
Important!All paths in
magnus.conf
must be absolute; paths in obj.conf
must be relative to the Chroot directory.
SYNTAXChroot directory directory is the full pathname to the directory used as the server's root directory.
DEFAULTThere is no default.
EXAMPLES
Chroot /d/ns-httpd
Chroot /www
SYNTAXDNS [on|off]
DEFAULTHostname resolution is on as a default.
EXAMPLEDNS on
SYNTAXSecurity [on|off]
DEFAULTBy default, security is off.
EXAMPLESecurity off
SYNTAX
ServerKey keyfilekeyfile is the server's key file, specified as a relative path from the server root or as an absolute path.
SYNTAX
ServerCert certfilecertfile is the server's certificate file, specified as a relative path from the server root or as an absolute path.
SYNTAX
Ciphers +rc4 +rc4export -rc2 -rc2export +idea +des +desede3A + means the cipher is active, and a - means the cipher is inactive.
Also, with cgi-bin directories, all files are treated as programs and are run rather than sent. If you create a CGI template and assign the template to CGI programs (using name translation), then you can have any number of CGI directories and they all use the template configuration.
<Object ppath=wildcardpattern>
Directives
<Client dns=wildcardpattern>
Directives
</Client>
</Object>
<Object name=cgi>
Directives
</Object>You use wildcard patterns to control what is grouped in the object, or you use a name to create a template. You then specify one or more directives to control what the server does when it encounters anything that uses the template or that matches the wildcard pattern specified with ppath. You can also set options for specific client hosts. This is a powerful feature because, unlike other servers where a host either can or cannot access a document, you make the server act differently for a client depending on the document they access. Although you don't need any <Client> sections in an object section, you can specify more than one--so the server acts differently based both on who requests something and what they request.
Directive fn=function [parameter1=value1][parameterN=valueN]Directive identifies an aspect of server operation. This string is case insensitive and must appear at the beginning of a line. Function is a function and parameters given to the directive. Its format depends on the directive.
Comment lines begin with a # character with no leading white space.Directive lines can contain white space at the beginning of the line and between the directive and value, but trailing white space after the value might confuse the server. Long lines (which should only occur with the Init directive) can be continued with a space before the linefeed.
<Object ppath="/user/public/*">The Service directive tells the server to get the documents by default. Sample obj.conf file
PathCheck fn=deny-existence
Service fn=server-retrieve
</Object>
#
# Sample obj.conf file for Netscape server 2.0.
#
# This file was automatically generated by the server.
# Edit at your own risk.
# The default object. This is what the server uses if none of the other
# objects fit.
#
# This one has a CGI directory specified in /usr/local/bin/cgi,
# a directory mapping to a bigger disk in /gig-drive/sales,
# and a document root of /usr/http-docs
#
# Initializations, such as log files and loading NSAPI libraries
Init format.access="%Ses->client.ip% - %Req->vars.auth-user% [%SYSDATE%] \"%Req->reqpb.clf-request%\" %Req->srvhdrs.clf-status% %Req->srvhdrs.content-length%" fn="flex-init" access="/usr/ns-home/httpd-80/logs/access"
Init fn=load-types mime-types=mime.types
Init fn="dns-cache-init" cache-size="512" expire="1200"
<Object name="default">
NameTrans from="/ns-icons" fn="pfx2dir" dir="/usr/ns-home/ns-icons"
NameTrans from="/cgi-bin" dfn="pfx2dir" ir="/usr/local/bin/cgi" name="cgi"
NameTrans from="/sales" fn="pfx2dir" dir="/gig-drive/sales"
NameTrans root="/usr/http-docs" fn="document-root"
PathCheck fn="unix-uri-clean"
PathCheck fn="find-pathinfo"
PathCheck index-names="index.html,home.html" fn="find-index"
ObjectType fn="type-by-extension"
ObjectType fn="force-type" type="text/plain"
Service fn="imagemap" method="(GET|HEAD)" type="magnus-internal/imagemap"
Service fn="index-common" method="(GET|HEAD)" type="magnus-internal/directory"
Service fn="send-cgi" type="magnus-internal/cgi"
Service fn="send-file" method="(GET|HEAD)" type="*~magnus-internal/*"
AddLog fn="flex-log" name="access"
</Object>
# All CGI directories have these configuration options set
<Object name="cgi">
ObjectType fn="force-type" type="magnus-internal/cgi"
Service fn="send-cgi"
</Object>
<Object name="default">
NameTrans fn="pfx2dir" from="/mc-icons" dir="/usr/home/mc-icons"
NameTrans fn="document-root" root="/usr/http-docs"
PathCheck fn="unix-uri-clean"
PathCheck fn="find-pathinfo"
ObjectType fn="type-by-extension"
ObjectType fn="force-type" type="text/plain"
Service fn="imagemap" method="(GET|HEAD)"
type="magnus-internal/imagemap"
Service fn="index-common" method="(GET|HEAD)"
type="magnus-internal/directory"
Service fn="send-file" method="(GET|HEAD)"
type="*~magnus-internal/*"
</Object>
<Object name="cgi">
ObjectType fn="force-type" type="magnus-internal/cgi"
Service fn="send-cgi"
</Object>
SYNTAXInit fn=function-name [parm1=value1][parmN=valueN] function-name identifies the server initialization function to call. These functions shouldn't be called more than once. parm=value pairs are values for function-specific parameters. The number of parameters depends on the function you use. The order of parameters doesn't matter. The following Init functions are described in detail in the following sections:
PARAMETERSmime-types specifies either the full path to the global MIME types file or a file name relative to the server configuration directory. The server comes with a default file called mime.types. local-types is an optional parameter to a file with the same format as the global MIME types file, but it is used to maintain types that are applicable only to your server.
EXAMPLES
Init fn=load-types mime-types=mime.types
Init fn=load-types mime-types=/tp/mime.types \
local-types=local.types
init-clf
function initializes the Common Log subsystem. It opens the log files whose names are given as parameters. The log files stay open until the server is shut down or until the base server process is sent the -HUP signal (at which time the logs are closed and re-opened).
Initializing this function is required if you are using the common log features.You use this function to specify which log files the server uses to record transactions. Then, you use the AddLog directive in the obj.conf file to specify the log file where the server stores the transaction record. For example, you use init-clf to specify a name that refers to a log file (such as http-log=/var/ns-server/loghttp); then you use the name with the AddLog function in obj.conf to add a log entry to the file (such as AddLog fn=server-log name=http-log). If you ever change the path or file name of the log file, you only do it once--in magnus.conf--instead of multiple times in obj.conf.
NoteYou also can use AddLog to store transactions in more than one log file. If you move, remove, or change the log file without shutting down or restarting the server, client accesses might not be recorded. To save or backup a log file, you need to rename the file and then send the -HUP signal to restart the server. The server uses the inode number, but when you do a soft restart, the server first looks for the file name, and if it doesn't find the log file, it creates a new one (the renamed original log file is left for you to use).
PARAMETERSAt least one log file should be given. The parm part of the parm=value pair should be a unique name for the log file. You will use this name later on, as a parameter to the server-log function.
EXAMPLES
Init fn=init-clf global=/var/ns-server/logs/access
Init fn=init-clf global=/tmp/server-access
init-uhome
function loads information about the system's user home directories into internal hash tables. This increases the shared memory size slightly, but saves CPU cycles for servers that have a lot of traffic to home directories.
PARAMETERSpwfile (optional) specifies the full file system path to a file other than /etc/passwd. If not listed, the default (NIS or /etc/passwd) is used.
EXAMPLES
Init fn=init-uhome
Init fn=init-uhome pwfile=/etc/passwd-http
DEFAULT
Init fn=cindex-init widths=22,1,1,33
PARAMETERSopts (optional) specifies options to activate for indexing. You specify a string of letters, one for each option to activate:
EXAMPLES
Init fn=cindex-init widths=50,1,1,0
Init fn=cindex-init widths=50,1,1,30 opts=s
Init fn=cindex-init widths=22,0,0,50 opts=is
MALLOC
, REALLOC
, STRDUP
, and FREE
work slightly differently. If pooling is enabled, the server automatically cleans up all memory allocated by these routines when the request completes. In most cases, this clean-up will not cause code to break.
The pool-init function affects any NSAPI code that is recompiled with Netscape 2.0 header files. If your code is not recompiled, it will not break. If you plan to recompile and want persistent memory allocation, add the prefix PERM_ to each routine (PERM_MALLOC, PERM_REALLOC, PERM_STRDUP, and PERM_FREE). If you're programming with NSAPI, you should change to the PERM_ versions, even if you do not plan to recompile.
NoteIf you're using Init functions to allocate memory, it will be allocated as persistent memory, even if you use MALLOC. The server cleans up only the memory that was allocated while processing a request, and because Init functions are run before processing any requests, the clean-up is performed anyway.
SYNTAX
Init fn=pool-init
The pool-init function is on by default. To disable it, replace Init fn=pool-init
with Init fn=pool-init disable=true
in the obj.conf
file.
EXAMPLE
Init fn=pool-init
SYNTAX
Init fn=cache-init cache-size mmap-max
The cache-init function has three arguments:cache-size
--Specifies the size of the cache. Valid values for the number of elements in the cache are 32 to 32768; the default is 512.
cache-size
value, it should be greater than the
number of URLs on your server. When counting URLs, you should include
any static HTML file such as images, sounds, or any other unchanging data.
URLs that are dynamic (such as CGI or NSAPI routines) return different data,
depending on who called them, and should not be counted.
mmap-max
--Specifies the maximum number of memory-mapped (mmap) files the server will keep open at any point. Acceptable values range from 512K to (512*1024)K; the default is 10000K (10MB).
mmap-max
should be on your system,
approximately compute the total number of bytes of "static" data that's on
your system. For example, if you have 200 files that are 10K in size, then
2MB should be sufficient for mmax-map.
disable
--If specified, disables the cache.
NoteTo optimize server speed, having enough RAM for the server and cache is ideal because swapping can be slow. Do not allocate a cache that is greater in size than the amount of memory on the system.
EXAMPLE
Init fn="cache-init" cache-size="512" mmap-max="10000"
SYNTAX
Init fn=dns-cache-init cache-size expire
PARAMETERSThe
dns-cache-init
function takes two arguments, cache-size
and expire
.
cache-size
specifies how many entries are contained in the cache. Acceptable values for cache-size
are 32 to 32768; the default value is 1024.
expire
specifies how long it takes for a cache entry to expire. Acceptable values (specified in seconds) for expire
are 1 second to 1 year; the default is 1200 seconds (20 minutes).
EXAMPLE
Init fn="dns-cache-init" cache-size="2140" expire="600"
DESCRIPTIONbasic-ncsa translates authorization information provided through the basic server authorization scheme. This scheme is similar to the HTTP authorization scheme, but doesn't interfere with it, so using server authorization doesn't prevent the ability to authenticate to the remote server. This function is usually used in conjunction with the PathCheck function require-server-auth.
PARAMETERSauth-type specifies the type of authorization to be used. This should always be "basic." dbm specifies the full path and base filename of the user database in the server's native format. The native format is a system DBM file, which is a hashed file format allowing instantaneous access to billions of users. If you use this parameter, don't use userfile as well. userfile specifies the full pathname of the user database in the NCSA-style httpd user file format. This format consists of lines using the format name:password, where password is encrypted. If you use this parameter, don't use the next one. grpfile (optional) specifies the NCSA-style httpd group file to be used. Each line of a group file consists of group:user1 user2userN where each user is separated by spaces.
EXAMPLES
AuthTrans fn=basic-ncsa auth-type=basic
dbm=/var/ns-server/userdb/rs
AuthTrans fn=basic-ncsa auth-type=basic
userfile=/var/ns-server/.htpasswd
grpfile=/var/ns-server/.grpfile
DESCRIPTIONpfx2dir looks for a directory prefix in the path and replaces the prefix with a real directory name. Don't use trailing slashes in either the prefix or the directory.
PARAMETERSfrom is the prefix to map. dir is the directory that the prefix is mapped to. name (optional) gives a named object (template) from which to derive configuration for this mirror site.
EXAMPLES
NameTrans fn=pfx2dir from=/cgi-bin dir=/httpd/cgi-bin name=cgi
NameTrans fn=pfx2dir from=/icons dir=/httpd/mc-icons
Public information directories
DESCRIPTIONThe unix-home function lets your internal users provide information to external users. You specify a URL prefix that corresponds to the user directories. Any request that begins with the prefix is translated to the user's home directory. You specify the list of users with either the /etc/passwd file or a file with a similar structure. Each line in the file should have this structure (elements in the
passwd
file that aren't needed are indicated with *):
username:*:*:groupid:*:homedir:*If you want to have the server scan the password file only once at startup, use the Init function init-uhome.
PARAMETERSfrom is the URL prefix to translate. subdir is the subdirectory of the user's directory that contains their documents. pwfile is the full path and file name of the password file you want to use, if it's different from /etc/passwd or the NIS database. name (optional) specifies a named object that configures this directory.
EXAMPLES
NameTrans fn=unix-home prefix=/~ subdir=public_html name=userhome
NameTrans fn=unix-home prefix=/u subdir=public_html name=userhome
Document root
DESCRIPTIONThe document-root function specifies the directory that contains all of your documents. This directory is prepended to the virtual path that the client sends to form the full pathname of the file or directory. For example, the client sends /home/file.html, which is translated to docroot/home/file.html.
PARAMETERSroot specifies the document directory.
EXAMPLES
NameTrans fn=document-root root=/netscape/docs
Redirection
DESCRIPTIONThe redirect function lets you change URLs and send the updated URL to the client. When a client accesses your server with an old path, they are told to use the new URL you provide.
PARAMETERSfrom specifies the old path. url specifies a complete URL to return to the client. If you use this parameter, don't use url-prefix (and vice-versa). url-prefix is the new URL to pass to the client. The from prefix is simply replaced by this URL prefix.
EXAMPLES
NameTrans fn=redirect from=/ url-prefix=http://tmpserver
nameTrans fn=redirect from=/toopopular
url=http://bigger/better/stronger/morepopular/new.html
Home page
DESCRIPTIONThe home-page function specifies the home page for your server. Whenever a user doesn't specify a path, they'll get an index file for the document root directory. If you use this function, you specify the .HTML file they see instead. This file must be on the server's local filesystem.
PARAMETERSpath is the path and name of the home page .HTML file.
EXAMPLES
NameTrans fn=home-page path=homepage.html
NameTrans fn=home-page path=/httpd/docs/home.html
DESCRIPTIONThe unix-uri-clean function denies access to any requested URL that contains /./, /../ or // (these URLs are potential security problems). If you use scripts with these elements in paths, use the find-pathinfo function (described in the next section) before unix-uri-clean.
PARAMETERSNone.
EXAMPLES
PathCheck fn=unix-uri-clean
Find index files for directories
DESCRIPTIONThe find-index function determines if the requested path is a directory. If it is, the function searches for an index file in the directory, and then changes the path to point to the index file. If no index file is found, the server generates a directory listing.
PARAMETERSindex-names is a comma-separated list of index file names to look for. Use spaces only if they are part of a file name.
EXAMPLES
PathCheck fn=find-index index-names=index.html,home.html
Require authorization
DESCRIPTIONThe require-auth function allows access to objects only if the user or group is authorized. You must use the AuthTrans directive before using the PathCheck directive with this function.
PARAMETERSauth-type is the type of HTTP authorization to use. This currently can be only set to basic. realm is a string (enclosed in double-quotation marks) sent to the client application so users can see what object they need authorization for. auth-user (optional) specifies a list of users who get access. The list should be enclosed in parentheses with each user name separated by the | character. auth-group (optional) specifies a list of groups that get access. Groups are listed in the password-type file.
EXAMPLES
PathCheck fn=require-auth auth-type=basic realm="Marketing Plans"
auth-group=mktg auth-users=(jdoe|johnd|janed)
Deny path's existence
DESCRIPTIONThe deny-existence function sends a "not found" message when a client tries to access a specified path. If this function appears in a <client> region, then it performs access control. Note that "not found" is sent instead of "forbidden," which means the user can't tell if the path exists or not.
PARAMETERSpath (optional) is a wildcard pattern of the path to hide. If no paths are specified, then all paths are hidden. bong-msg specifies a file to send instead of the "not found" message. The file should be an HTML file specified as an absolute path.
EXAMPLES
PathCheck fn=deny-existence path=*/~
<client>
PathCheck fn=deny-existence bong-msg=/svr/msg/go-away.html
</client>
Find file system links
DESCRIPTIONThe find-links function searches the current path for symbolic or hard links to other directories or file systems. If any are found, the server returns an error. Usually you use this function in directories you don't trust (such as user home directories). This prevents someone from pointing to information that you don't want made public.
PARAMETERSdisable is a character string of links to disable:
EXAMPLES
PathCheck fn=find-links disable=sh dir=/foreign-dir
PathCheck fn=find-links disable=so dir=public_html
Find path information
DESCRIPTIONThe find-pathinfo function uses extra path information if it can't find a file in a specified path. Extra path information is included after the path and file in the URL.
PARAMETERSNone.
EXAMPLES
PathCheck fn=find-pathinfo
DESCRIPTIONThe type-by-extension function uses file extensions to determine information about files. (Extensions are strings after the last period in a file name.) This matches an incoming request to extensions in the mime.types file. The MIME type is added to the "content-type" header sent back to the client. The type can be set to internal server types that have special results when combined with function you write using the NSAPI. See the Programmer's Guide for more information.
PARAMETERSNone.
EXAMPLES
ObjectType fn=type-by-extension
Image switching
DESCRIPTIONThe image switching function allows the server to send a corresponding file of a different type (if the file exists in the same directory) to the client. For example, if someone is using Netscape Navigator to request a graphic.gif file from a Netscape server, and there is a graphic.jpg file in the same server directory, the server will send graphic.jpg to the client. The user will see the requested image, but in JPEG format, which has better color depth and higher compression than GIF images.
PARAMETERSNone.
EXAMPLES
ObjectType fn=image-switch
File typing by wildcard pattern
DESCRIPTIONThe type-by-exp function matches the current path with a wildcard expression. If the two match, the type parameter information is applied to the file. This is the same as type by extension, except you use wildcard patterns for the files or directories specified in the URLs.
PARAMETERSexp is the wildcard pattern of files or directories that the information is applied to. type (optional) is the type to assign to any matching files. enc (optional) is the encoding given to matching files (the "content-encoding" header). lang (optional) is the language assigned to matching paths.
EXAMPLES
ObjectType fn=type-by-exp exp=*.test type=application/html
Forcing file types
DESCRIPTIONThe
force-type
function assigns a type to objects that do not already have a MIME type. This is used to specify a default object type.
PARAMETERStype is the type to assign to matching files. enc (optional) is the encoding given to matching files. lang (optional) is the language assigned to matching paths.
EXAMPLES
ObjectType fn=force-type type=text/plain
ObjectType fn=force-type lang=en_US
Server-parsed HTML
DESCRIPTIONThe shtml-hacktype function provides backward compatibility with server-side includes. Server-side includes require a different MIME type than HTML. This means that your parsed documents must have different file extensions than nonparsed documents. If this is a problem, this function can be used as a solution. Another is to have the server parse all HTML, but this can have detrimental performance effects. You can also check for the execute bit on the file. If it's there, the file is parsed; otherwise, it isn't. None of these solutions is recommended. See the Programmer's Guide for more information on server-parsed HTML.
PARAMETERSexec-hack (optional) checks if the execute bit is enables for the file. If you don't specify this parameter, all files are marked as parsed.
EXAMPLES
ObjectType fn=shtml-hacktype exec-hack=true
DESCRIPTIONThe send-file function sends the contents of a plain text file to the client. If this function finds any extra path information, it doesn't send the text file to the client.
PARAMETERSNone.
EXAMPLES
Service type=*~magnus-internal/* method=(GET|HEAD) fn=send-file
Send an error message
DESCRIPTIONThe send-error function sends an HTML file to the client regardless of the path the client requested. This is used mainly for error messages.
PARAMETERSpath specifies the full file system path of the HTML file.
EXAMPLES
Service fn=send-error path=/popular/service/we-moved.html
Service fn=send-error path=/http/errors/no-post.html
Append a trailer to HTML documents
DESCRIPTIONThe append-trailer function appends text to the end of every HTML document from the object. This is mainly used for author information and copyright text. The date the file was last modified can automatically be included. If there is extra path information, the request is flagged as not found and the document isn't send to the client.
PARAMETERStrailer is the text you want to append to all HTML documents. The text can contain HTML tags and can be approximately 700 characters long. The string :LASTMOD: is substituted with the date the file was last modified; you must also specify a time format with timefmt. timefmt is a time string in the strftime function format. See your operating system's manual for this format.
EXAMPLES
Service fn=Service type=text/html fn=append-trailer
trailer="<hr><img scr=/logo,gif> Copyright 1995"
Service fn=Service type=text/html fn=append-trailer timefmt="%D"
trailer="<hr>File last updated on: :LASTMOD:"
Run a CGI program
DESCRIPTIONThe send-cgi function runs a file as a CGI program and sends the results to the client.
PARAMETERSNone.
EXAMPLES
Service fn=send-cgi
Service type=magnus_internal/cgi fn=send-cgi
Set a default query handler
DESCRIPTIONThe query-handler function runs a CGI program instead of referencing the path requested. This is used mainly to support the obsolete ISINDEX tag. If possible, use a FORM instead.
PARAMETERSpath is the full path and file name of the CGI program to run.
EXAMPLES
Service query=* fn=query-handler path=/http/cgi/do-grep
Service query=* fn=query-handler path=/http/cgi/proc-info
Use an imagemap
DESCRIPTIONThe imagemap function includes imagemap files.
PARAMETERSNone.
EXAMPLES
Service type=magnus_internal/imagemap method=(GET|HEAD) fn=imagemap
Simple directory indexing
DESCRIPTIONThe index-simple function scans a directory and produces an HTML file of a bulleted list of files in the directory. Each file appears as a link. If this function encounters a subdirectory, the link redirects the user to the subdirectory. In directories with subdirectories, use fancy indexing as described in the following section.
PARAMETERSNone.
EXAMPLES
Service type=magnus-internal/directory fn=index-simple
Fancy directory indexing
DESCRIPTIONThe index-common function scans a directory and produces an HTML file of a bulleted list of files in the directory. Each file appears as a link. This function produces a format common to the CERN and NCSA HTTP servers. It includes more information than simple indexing and references icon files.
PARAMETERSheader is a file to prepend to the indexing that introduces the contents of the directory. If you specify a file name for this parameter, the server looks for the file name as an .HTML file, and then incorporates the file in the directory list as HTML; otherwise, the file is included as plain text. readme is a file (HTML or plain text) to append to the indexing. This gives more information about the contents of the directory.
EXAMPLES
Service type=magnus_internal/directory method=(GET|HEAD) fn=index-common header=hdr.html readme=end-text.txt
Parsed HTML (server-side includes)
DESCRIPTIONThe parse-html function parses an HTML document, scanning for embedded server directives. These server directives provide certain information only the server has, or they include the contents of other files. Parsing lots of HTML documents can reduce server performance.
PARAMETERSopts are parsing options. The no-exec option is the only currently available option--it disables the exec directive.
EXAMPLES
Service type=magnus_internal/parsed-html method=(GET|HEAD) fn=parse-html
DESCRIPTIONcommon-log is an AddLog function that records request-specific data in the common log format (used by most HTTP servers). There is a log analyzer in the /extras directory. There are also a number of free statistics generators for the common format. The log format is specified by the init-server function call.
PARAMETERSname (optional) gives the name of a log file, which must have been given as a parameter to the init-clf Init function. If no name is given, global is assumed. iponly (optional) instructs the server to skip looking up the host name of the remote client and records the IP address instead. The value of iponly has no significance, as long as it exists; the Administration forms set iponly="1".
EXAMPLES
# Log all accesses to the central log file
AddLog fn=common-log
# Log non-local accesses to another log file
<Client ip=*~198.93.9[2345].*>
AddLog fn=common-log name=nonlocal
</Client>
Record the client software name
DESCRIPTIONThe record-useragent function records the IP address of each client, followed by their User-Agent HTTP header. This tells the server what version of Netscape Navigator (or which other browser) the client used for this transaction.
PARAMETERSname (optional) gives the name of the log file where the log is recorded--it must have been specified with the init-clf function. If no name is listed, the log is recorded in global.
EXAMPLES
AddLog fn=record-useragent name=browsers-used
PARAMETERSreason gives one of the above strings (the text in bold, such as unauthorized or forbidden). Code sends the three-digit number, such as 401 or 407.
EXAMPLES
Error fn=send-error Code=401 path=/var/ns-server/errors/401.html
#--Netscape Communications Corporation MIME InformationOther non-comment lines have the following format:
type=type/subtype exts=[file extensions] icon=icon
Sample mime.types file
#--Netscape Communications Corporation MIME Information
# Do not delete the above line. It is used to identify the file type.
type=application/octet-stream exts=bin,exe
type=application/oda exts=oda
type=application/pdf exts=pdf
type=application/postscript exts=ai,eps,ps
type=application/rtf exts=rtf
type=application/x-mif exts=mif
type=application/x-csh exts=csh
type=application/x-dvi exts=dvi
type=application/x-hdf exts=hdf
type=application/x-latex exts=latex
type=application/x-netcdf exts=nc,cdf
type=application/x-sh exts=sh
type=application/x-tcl exts=tcl
type=application/x-tex exts=tex
type=application/x-texinfo exts=texinfo,texi
type=application/x-troff exts=t,tr,roff
type=application/x-troff-man exts=man
type=application/x-troff-me exts=me
type=application/x-troff-ms exts=ms
type=application/x-wais-source exts=src
type=application/zip exts=zip
type=application/x-gtar exts=gtar
type=application/x-shar exts=shar
type=application/x-tar exts=tar
type=application/mac-binhex40 exts=hqx
type=audio/basic exts=au,snd
type=audio/x-aiff exts=aif,aiff,aifc
type=audio/x-wav exts=wav
type=image/gif exts=gif
type=image/ief exts=ief
type=image/jpeg exts=jpeg,jpg,jpe
type=image/tiff exts=tiff,tif
type=image/x-cmu-raster exts=ras
type=image/x-portable-anymap exts=pnm
type=image/x-portable-bitmap exts=pbm
type=image/x-portable-graymap exts=pgm
type=image/x-portable-pixmap exts=ppm
type=image/x-rgb exts=rgb
type=image/x-xbitmap exts=xbm
type=image/x-xpixmap exts=xpm
type=image/x-xwindowdump exts=xwd
type=text/html exts=htm,html
type=text/plain exts=txt
type=text/richtext exts=rtx
type=text/tab-separated-values exts=tsv
type=text/x-setext exts=etx
type=video/mpeg exts=mpeg,mpg,mpe
type=video/quicktime exts=qt,mov
type=video/x-msvideo exts=avi
type=video/x-sgi-movie exts=movie
enc=x-gzip exts=gz
enc=x-compress exts=z
enc=x-uuencode exts=uu,uue
type=magnus-internal/imagemap exts=map
type=magnus-internal/parsed-html exts=shtml
type=magnus-internal/cgi exts=cgi,exe,bat
Warning!Because you can do this, it is important to keep secure the server's UNIX ID account and to ensure that only that server account and the root account have full (write) access to the server root directory. This way, only someone running as root or with the server's user account can enter the [ServerRoot]/admserv directory and edit the
admpw
file.