Extentions to httpd

Roy Smith ([email protected])
Tue, 20 Jul 93 14:05:36 -0400


I'm not sure if this is a html-related, or http-related, or what
exactly, but let me throw out some ideas I'm mulling over and see what
people think about them. I'm relatively new to this game, so I may be
reinventing the wheel, or just making a wheel with a shape that doesn't
roll very well.

This all started with problems getting gopher and www to interact
"properly". We want to be able to do waisindex searches of html document
collections. If we call gopher to do that (with a gopher://.... URL) we
get the search executed correctly but we're stuck in gopher-space, with no
way (that I can see) to get back to http-space. Similar problems occur
with doing CSO searches. I have to do them through gopher, and the various
clients have too much (to my mind) knowledge of what a CSO search is built
in to them.

Anyway, this is my idea. I want to hack httpd (I'm working from
NCSA's version 0.4) to allow executing external programs. If a http URL
starts with a |, httpd would treat the rest of the URL string as a program
to execute and pipe the result back to the client. Anything after a "?"
would be passed to the program as arguments. Obviously, there are security
issues to be resolved here; you can't allow people to just execute anything
on your system, but that's a detail to be worked out.

Here's an example:

Let's say I want to set up a waisindex search. I put the following
somewhere in a html file:

<A HREF="http://myhost.mydomain/|wwwbin/">Microbiology</A>

The wwwbin program looks at its arguments. If there are none, it
emits something like:

<isindex>
<H1>Please enter a keyword to be used for searching</H1>

If wwwbin has arguments (i.e. the stuff after the "?"), it uses
those arguments to execute the search and sends back a page of html
containing the results.

Does this seem like a reasonable approach? It involves hacking the
server slightly, but it requires no changes to any client. It also allows
me to easily customize how a search looks by just altering some external
program (which could very well be a shell script). My initial complaint
that got me thinking along these lines what the XMosaic has the format of a
CSO search page built in. With my scheme, you can tear all that out of
XMosaic, and put it in the server side, allowing the database administrator
to determine what it looks like (for example, I might want to include some
explanitory note, warning, copyright notice, etc).