GoServe -- A Web and Gopher Server for OS/2
Two popular protocols for providing information on the Internet are the HyperText Transfer Protocol (HTTP, used by World-Wide Web clients) and Gopher (used by both Web and Gopher clients).
GoServe' is a multi-purpose server for OS/2 which supports both these protocols. The emphasis in the design of GoServe has been to make it easy to become an information provider for the Internet, while not inhibiting full use of the protocols by sophisticated users.
Providing that you already have TCP/IP installed, GoServe can be running and serving files across a network in minutes; no re-boot or editing of configuration files is necessary. The GoServe package includes 'quick start' instructions and working samples for both Web and Gopher servers.
GoServe processes requests from Web or Gopher clients using a Rexx script to allow for customization. A server can handle requests from many clients, using OS/2 threads and script caching for efficiency. Multiple servers can be started (using different ports), and an audit trail of requests and actions can be recorded. When running as a Web server, much of the complexity of the Web protocol is handled automatically; many GoServe users will only need to be concerned about the data being provided, and need not be concerned about the mechanism.
While running, a graphical display of GoServe activity is shown with optional response-time graphing and audible indication of connections. For control, various restrictions may be employed to limit the load on the server machine. GoServe operations can be controlled remotely, if desired, using any Web client (or an OS/2 CMD program).
GoServe is a 32-bit OS/2 application, which requires OS/2 2.x or OS/2 Warp. GoServe
requires IBM TCP/IP for OS/2, or equivalent, to be installed and operational (either on a real
network or using the loopback driver). GoServe may be used as both a Web server and a Gopher
server on the same server machine, on one or more ports for each, if required.
How GoServe is used
GoServe is an ordinary 32-bit OS/2 application program (it has no special privileges, and uses only public interfaces to OS/2 and to TCP/IP). Once started, GoServe sets up a TCP/IP socket on the 'well-known' port for the protocol selected (this can be altered using a different startup parameter), then waits for requests from clients. When a request from a client arrives, it is recorded in the audit file (if desired) and then the GoServe filter for the port is called.
The GoServe filter is a program written in Rexx, which is given details of the client and the request string. The filter decides on the information (usually a file, containing a document or other data) to be sent to the client, and returns details to GoServe. GoServe then sends
the HTTP response and the data to the client and closes the TCP/IP connection.
Each incoming request is given a new OS/2 thread for communication, filter processing, and response. GoServe handles all the details of threads and TCP/IP communications, so you need only be concerned with the filter (which can often simply be the sample filter, unchanged) and the data (documents, images, etc.).
GoServe is designed to perform well, even on inexpensive hardware. Some of the default
settings, however, are chosen for safety rather than best performance. To maximize performance
and throughput,the File command must be turned on.
--- Requirements ---
GoServe is a 32-bit OS/2 application, which requires OS/2 2.x or OS/2 Warp. For OS/2 Warp, version 1.31 (or later) of GoServe is needed.
GoServe requires TCP/IP for OS/2, or equivalent, to be installed and operational (either on a real network or using the loopback driver).
--- Running GoServe 'stand-alone' ---
GoServe and Web Explorer can be run on a stand-alone machine that is not connected to a
network, provided that TCP/IP is installed and the loopback driver is started. This is especially
useful for developing Web pages offline, or for demonstrations.
--- Automatic HTTP processing ---
GoServe automates several aspects of the HTTP/1.0 protocol. When an HTTP/1.0 request is received, the HTTP header lines are read automatically (if needed). The Content-Length and If-Modified-Since values are extracted as appropriate.
When a completion command is processed, GoServe will (if the incoming request was
HTTP/1.0) generate an appropriate response line and HTTP header.
Why not CGI?
Many Web servers support a protocol known as the Common Gateway Interface (CGI) for attaching and supporting scripts. GoServe does not yet support this interface directly due to a number of difficulties with the design. GoServe's filters provide equivalent function, and the processing logic will be essentially unchanged, so ports of the algorithms required are easy.
If necessary (for example, to use an existing CGI script), the CGI interface can be
simulated by a GoServe filter. Porting the script will, however, give much better response times
in many cases.