![]() | :: | Software | :: | shttpd |
cgiuser-httpd progwhere prog is one or more arguments specifying a program to run for each valid request.
cgiuser-httpd behaves like cgi-httpd with two exceptions: cgiuser-httpd does not invoke chroot, and it sets the execution path to /bin:/usr/bin before invoking prog.
cgiuser-httpd reads an HTTP request message from standard input, and treats the URI path as the name of a CGI script. The script is expected to print its reply to standard output.
Before reading any input, cgiuser-httpd changes the working directory to that named in the $ROOT environment variable, and then sets its group id and user id to the numeric values given in the environment variables $GID and $UID, typically set with envdir. Before executing prog, cgiuser-httpd sets the execution path to /bin:/usr/bin. If it cannot carry out these operations, cgiuser-httpd complains to standard output and exits 111.
If it encounters an error in processing a request, cgiuser-httpd exits 21. Otherwise, it returns the exit code of prog.
For a request specifying the hostname H, cgiuser-httpd changes its working directory to ./host/H after replacing /. with /: and // with / in ./host/H. When a valid request lacks a host name, cgiuser-httpd uses 0 as the host name. After changing the working directory, cgiuser-httpd sets the cgi environment variables and executes prog.
cgiuser-httpd accepts HTTP/0.9, HTTP/1.0, and HTTP/1.1 requests. It supports HEAD, GET, and POST, and rejects all other methods.
cgiuser-httpd manipulates the following environment variables:
$AUTH_TYPE is unset.
$CONTENT_LENGTH is the content length of the request, if applicable, or unset.
$CONTENT_TYPE is the content type of the request, if applicable, or unset.
$GATEWAY_INTERFACE is the string CGI/1.1
$PATH_INFO is the path portion of the request URI, after URL decoding.
$PATH_TRANSLATED is unset.
$QUERY_STRING is the query string portion of the request URI.
$REMOTE_ADDR is set to the value of the environment variable $TCPREMOTEIP.
$REMOTE_HOST is set to the value of the environment variable $TCPREMOTEHOST.
$REMOTE_USER is set to the value of the environment variable $TCPREMOTEINFO.
$REQUEST_METHOD is set to the method of the request URI.
$SCRIPT_NAME is the empty string.
$SERVER_NAME is the name of the host given in the request, if applicable, and 0 otherwise.
$SERVER_PORT is the value of the environment variable $TCPLOCALPORT.
$SERVER_PROTOCOL is one of the strings HTTP/0.9, HTTP/1.0, or HTTP/1.1.
$SERVER_SOFTWARE is the string cgiuser-httpd.