hserv.rexx 1.0

by Alfonso Ranieri - Casey Halverson

DISCLAIMER:
THIS SOFTWARE AND INFORMATION ARE PROVIDED "AS IS".
ALL USE IS AT YOUR OWN RISK, AND NO LIABILITY OR
RESPONSIBILITY IS ASSUMED.
NO WARRANTIES ARE MADE.

1. Description

   A http server, a simple example of the inetd support in rxsocket.library.


2. Installation

   copy rxsocket.library to LIBS:
   copy rmh.library TO LIBS:
   copy rxs to C:
   write in a shell
    rx "call addlib('rexxsupport.library',0,-30)"
    rx "call addlib('rxsocket.library',0,-30)"
    rx "call addlib('rmh.library',30,-30)"
  make a directory called hserv in ram:
  copy directory hserv in ram:hserv

  If running on AmiTCP
   open AmiTCP:db/service and the line
    http		80/tcp
   open AmiTCP:inetd.conf and add the line
    http stream tcp nowait root c:rxs c:rxs "ram:hserv/main/hserv.rexx ram:hserv/main/hserv.conf"

  If running on Miami
   open Miami/DataBase/service window
   press "Add" gadget
   add the line:
    Name: http
    ID: 80
    Protocol: tcp
   open Miami/DataBase/InetD window
   press "Add" gadget
    add the line:
    Service: http
    Socket: stream
    Protocol: tcp
    Wait: nowait
    User: root
    Server: c:rxs
    Name: c:rxs
    Args: "ram:hserv/main/hserv.rexx ram:hserv/main/hserv.conf"

The installation is complete.
To test the server, open a browser and go to the url <http://localhost>.


3. Configuration options:

   hserv.rexx needs 1 argument: the configuration file.
   It is a text file, each line rappresenting a configuration option.
   Empty line or line beginning with # are ignored in parsing.
   Each option line consists in optionName optionArgs.
   Valid optionName are:

    Name            Arg         Description
    RootDir         path        the root dir for logs and function
    DocumentDir     path        the root dir for the html files
    DocumentIndex   name        the file returned if no file name request
    HostnameLookups ON|OFF      lookup hostname
    ErrorLog        ON|OFF|SYS  log error?
    ErrorFile       file        error file name - path is RootDir
    TransferLog     ON|OFF|SYS  log transfers?
    TransferFile    file        transfers file name - path is RootDir
    Auth            ON|OFF      client need to have auth server running
    Timeout         secs        not implemented


4. Parsing

   The server reads each line of the documents and makes this parsing:

    change the string <!ip> with the peer name

    change the string <!user> with the user name, if auth is ON, or unknown
    if auth is OFF

    change the string <!power> with the string "Powered up with rxsocket.library"

    change the string <!CGI fun> with the result of a calling to the function fun
    that can be online or must be in RootDir

5. Note

   Most the code is from arexxwebserver.rexx by Casey Halverson.