---
name: "fdservlet"
section: "1"
platform: "linux"
package: "framerd"
version: "2.4.1-1.1"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/fdservlet"
---

# fdservlet(1)

execute a persistent FramerD "servlet" to handle CGI requests

## NAME

fdservlet - execute a persistent FramerD "servlet" to handle CGI requests

## SYNOPSIS

**fdservlet** *filename socket* **\[** *nthreads* **\]**

This starts an server which will receive and handle CGI requests mediated by the  **mod\_fdserv** module for the Apache webserver.  The *filename* argument may be either an FDScript file as would be handled by  **fdcgi** or an FDXML or FDHTML file as would be handled by **fdxml**

## DESCRIPTION

When started, this program opens up a Unix domain socket in the file *socket* to be used to communicate with the program.  It then starts a number of threads to respond to CGI requests issued on this socket.  To initiate a CGI request, a client (typically the **mod\_fdserv** module) makes a connection to the designated socket and gets back a communications socket.  It then sends a slotmap (represented as a DType) across the socket.  This slotmap is processed by fdservlet to extract special fields such as form variables, uploaded files, and individual cookies.  It then generates a response based on the content of the specified *filename*

If the file is an FDXML file, it is interpreted and sent to the client in response to any request.  If it is an FDCGI file, it may be handled in one of two ways.  First, if it defines a procedure  **(main),** this procedure will be called to respond to requests.   Otherwise, all of the expressions in the file are executed, in order, to respond to each request.

If the file *filename* changes between requests, it is reloaded.  In addition, any file loaded by an FDXML file will be reloaded if it changes.

When compiled without multithreading,  **fdservlet** still works, but will process only one request at a time, offering persistence but not parallelism.

## ENVIRONMENT

The procedure **(CGI-DATA)** returns the slotmap describing the current request.  The special form **(CGI-INIT** *vars...* **)** binds each  *var* to the string or list of strings passed under the name *var.* The special form  **(CGI-VAR** *vars...* **)** does the exact same thing except that the strings  strings are passed to the lisp parser (so the string "3" is converted to the number 3) and the lists are converted into choices of these parsed values.

The following variables are typically bound and accessible through these mechanisms, as well as any form variables or cookies received with the request.

- SERVER\_SOFTWARE

  The type and version of the web server passing on this CGI request

- SERVER\_NAME

  The name of the server passing on the request

- SERVER\_PORT

  The port on which the server is listening

- SCRIPT\_NAME

  The name of the script being run

- HTTP\_REFERER

  If provided, this is the document from which this script was invoked

- HTTP\_USER\_AGENT

  The kind of program making the request, often the web browser being used by the human requestor

- REMOTE\_IDENT

  Rarely provided, this is an identifier of the individual making the reauest

- REMOTE\_HOST

  This is the hostname of the machine from which the request apparently originated.

- REMOTE\_ADDR

  This is the IP address (dd.dd.dd.dd) of the machine from which the request apparently originated.

- PATH\_INFO

  This is the part of the URL which occurs after the script name but before any parameters

- DOCUMENT\_ROOT

  This is the document root

- PATH\_TRANSLATED

  This is the local file to which this request was translated

- AUTH\_TYPE

  This describes how the user authenticated her/him/itself.

- REMOTE\_USER

  This describes who the user authenticated her/him/itself as.

- HTTP\_COOKIE

  This is the "cookie" passed with this request.  The individual components of this cookie are separated out into separate fields in the **CGI-DATA** slotmap

- SERVER\_HOST

  This is host on which the server is running.  This will differ from  **SERVER\_NAME** only if virtual hosts are being used

- HTTPS

  This is true if the connection with client is a secure (SSL) connection.

- HTTP\_ACCEPT

  - HTTP\_ACCEPT\_CHARSET

  - HTTP\_ACCEPT\_ENCODING

  - HTTP\_ACCEPT\_LANGUAGE

  - REQUEST\_METHOD

  This is the request method.  Only  **GET** and **POST** are currently handled

- CONTENT\_TYPE

  This is the mime time of any data sent with the request

- CONTENT\_LENGTH

  This is the number of bytes of data sent along with the request

- QUERY\_STRING

  This is the query string passed with the request.  If it provides form variables (common when the REQUEST\_METHOD is GET), these variables are each broken out and assigned to the slotmap.

- POST\_DATA

  This is the actual data sent along with the request.  If the mime type is a text type, this is a string; otherwise, it is a packet.  If the post data contains form variables (either url-encoded or mime-encoded), these are broken out

- PARSED\_POST

  When the posted data is a multi-part mime document, this is the parsed document.

## BUGS

Doesn't work under WIN32 because of the lack of local (or "unix domain") sockets.

## Revision Info

**$Id: fdservlet.1,v 1.1 2002/05/29 18:38:01 haase Exp $**

## AUTHOR

Ken Haase \< kh@beingmeta.com \>

## SEE ALSO

[**fdxml**(1)](/fdxml/1.md) [**fdcgi**(1)](/fdcgi/1.md) [**mod\_fdserv**(4)](/mod_fdserv/4.md)
