Name

server - Internet file server

Syntax

server

Description

Server processes any file server requests found in the server’s mailbox file. Requests are made by sending mail to server@host, putting the request in the Subject field of the message. If the “Subject:” field is blank or not found, the request is assumed to be in the first line of the body of the message.

Request commands are:

DIR [dir …]

Request directory listings

HELP

Request help on using the server

INDEX [dir …]

Request index files for the server directories

MAP [host …]

Request a site map from the host’s archives

SEND [dir/]file …

Request a file from the server’s archives

The optional [dir] argument (without the brackets, of course) is the name of a subdirectory area within the server’s main directory. The user needn’t specify a complete path to the directory, only the directory’s name. Example:

index apple2

Should the directory itself contain another directory, the user can access it by using a slash to separate the two (e.g. “index apple2/programs”).

The server commands (except for HELP) can take multiple arguments. Example:

send file1 file2 dir/file3

If the MAP command is given without an argument, a directory listing of the map archive area is sent.

Server Default Directories


By default, the server’s domain includes $/pub and all the directories within it, and the site maps are assumed to be found in $/sys/maps. The administrator may choose different paths to these areas by editing the server resource file ($/etc/rsrc/server.rsrc) and placing the complete path to the main server directory in the first line of the file, and the complete path to the map directory in the second line.

Notes On Using INDEX and DIR


When these commands are used without any arguments, the entire structure within the main server directory is referenced. This means that if DIR alone were specified, the user would get directories for all the subdirectories inside of the server’s domain. Likewise, INDEX alone would get indexes for all server areas.

When a directory argument is used with DIR or INDEX, the structure including that directory and its domain is referenced. In short, these commands return the entire tree (if no argument is given), or branches of the tree depending on the argument given. Most server archives have directory structures only a level or two deep.

Setting Up The Server


As stated, the server’s domain is the $/pub directory and all files and subdirectories within it. If your server archives contain numerous files it is best to organize them into subdirectory areas.

Each area (including $/pub) should contain a file named INDEX which gives a quick table of contents for that area. The INDEX file format is not rigid, though it should at least contain this information:

o

Name of the host system

o

Name of the area

o

Date when the index was last modified

o

Contents of the area

Typically, the content list contains entries, one per file, giving the name of the file and a short description. You can add more information if you desire, though it is best to be as brief as possible, giving only the information necessary for browsing.

Access Protection


The server abides by the permission attributes assigned to directories in the server archives. If a user requests a file from a directory that does not have read permission, the request is stored in the queue file called $/etc/server.req (which can be used as a shell script later on). The root user can validate each entry, removing those without clearance, then launch the file as a shell script in order for the file requests to be fulfilled. Example:

source server.req

The file’s type is text, and requires the shell’s “source” command in order to run.

Server Message


Every outgoing file sent by the server can also include an optional message. This message is stored in the $/etc/help/server.msg file. This could include short messages such as rules regarding server usage, and so on. It should probably end with a dashed “cut here” line to let the requester know when the real file starts.

Server Log


The server maintains a log file ($spool/logs/servlog) listing the requests and when they were processed.

Files

$/pub
server’s domain,
$/sys/maps
site map archive area,
$/sys/mail/server
server’s mailbox,
$spool/logs/servlog
server log file,
$/etc/server.req
server requests pending validation,
$/etc/help/server
server help file,
$/etc/help/server.msg
server message file,
$/etc/rsrc/server.rsrc
server’s resources.

See Also

rcp(NET), sendmail(C)