* added description of ROOTED-FILE-OR-DIRECTORY-HANDLER

* removed chapter 2.6 (Losing on NextStep)
This commit is contained in:
interp 2002-04-25 09:17:33 +00:00
parent d8025632f7
commit d61d187510
1 changed files with 31 additions and 43 deletions

View File

@ -325,6 +325,37 @@ and built upon (exported by the \ex{httpd\=basic\=handlers}-structure):
the file is served to the client.
\end{defundesc}
\begin{defundesc}{rooted-file-or-directory-handler}{root
icon-name}{path-handler}
Dito, but also serve directory indices for directories without
\ex{index.\ob{}html}. \semvar{icon-name} specifies how to generate
the links to various decorative icons for the listings. It can either
be a procedure which gets passed one of the icon tags listed below and
is expected to return a link pointing to the icon. If it is a string,
that is taken as prefix to which the names of the tags listed below
are appended.
\begin{tabular}{ll}
Tag & Icon's file name \\
\hline
\ex{directory} & \ex{directory.xbm}\\
\ex{text} & \ex{text.xbm}\\
\ex{doc} & \ex{doc.xbm}\\
\ex{image} & \ex{image.xbm}\\
\ex{movie} & \ex{movie.xbm}\\
\ex{audio} & \ex{sound.xbm}\\
\ex{archive} & \ex{tar.xbm}\\
\ex{compressed} & \ex{compressed.xbm}\\
\ex{uu} & \ex{uu.xbm}\\
\ex{binhex} & \ex{binhex.xbm}\\
\ex{binary} & \ex{binary.xbm}\\
\ex{blank} & \ex{blank.xbm}\\
\ex{back} & \ex{back.xbm}\\
\ex{\it{}else} & \ex{unknown.xbm}\\
\end{tabular}
\end{defundesc}
\begin{defundesc}{null-path-handler}{path req}{\noreturn}
This path handler is useful as a default handler. It handles no
requests, always returning a ``404 Not found'' reply to the client.
@ -392,49 +423,6 @@ The source files contain a host of support procedures which will be of
utility to anyone writing a custom path-handler. Read the files first.
\FIXME{Let us read the files and paste the contents here.}
\subsection{Losing}
Be aware of two Unix problems, which may require workarounds:
\begin{enumerate}
\item NeXTSTEP's Posix implementation of the \ex{get\ob{}pwnam()}
routine will silently tell you that every user has uid 0. This means
that if your server, running as root, does a
\codex{(set-uid (user->uid "nobody"))}
it will essentially do a
\codex{(set-uid 0)}
and you will thus still be running as root. The fix is to manually
find out who user nobody is (he's -2 on my system), and to hard-wire
this into the server:
\codex{(set-uid -2)}
This problem is NeXTSTEP specific. If you are using not using
NeXTSTEP, no problem.
\item On NeXTSTEP, the \ex{ip\=ad\ob{}dress->\ob{}host\=name}
translation routine (in C, \ex{get\ob{}host\ob{}by\ob{}addr()}; in
scsh, \ex{(host\=in\ob{}fo addr)}) does not use the DNS system; it
goes through NeXT's propietary Netinfo system, and may not return a
fully-qualified domain name. For example, on my system, I get
``\ex{ame\ob{}lia\=ear\ob{}hart}'', when I want
``\ex{ame\ob{}lia\=ear\ob{}hart.\ob{}lcs.\ob{}mit.\ob{}edu}''. Since
the server uses this name to construct redirection URL's to be sent
back to the Web client, they need to be FQDN's.
This problem may occur on other OS's; I cannot determine if
\ex{get\ob{}host\ob{}by\ob{}addr()} is required to return a FQDN or
not. (I would appreciate hearing the answer if you know; my local
Internet guru's couldn't tell me.)
If your system doesn't give you a complete Internet address when you
say
\codex{(host-info:name (host-info (system-name)))}
then you have this problem.
The server has a workaround. There is a procedure exported from the
\ex{httpd\=core} package:
\codex{(set-my-fqdn name)}
Call this to crow-bar the server's idea of its own Internet host
name before running the server, and all will be well.
\end{enumerate}
%%% Local Variables:
%%% mode: latex
%%% TeX-master: t