This is my cgi-bin zcat script. It requires the Z-Shell !  If you don't
have it, get it from

  ftp://ftp.math.gatech.edu/pub/zsh/zsh-2.5.03.tar.gz

Adjust the path to it in the first line in the zcat script if you
install it somewhere else that /usr/local/public.

Then edit zcat with your favourite text editor, for example, vi.

Change the lines between the comments according to your setup.

Then copy zcat to your cgi-bin directory, on my system it's
/usr/local/etc/httpd/cgi-bin. Be sure it has it's executable flag set
and it is executable by the user your httpd runs as.

The "zcat" mentioned in the zcat script is the zcat from GNU ZIP which
is a replacement for compress(1) you should have installed. You don't ?
Then you should do it, NOW.

Get it from 

  ftp://prep.ai.mit.edu/pub/gnu/gzip-1.2.4.tar

Now you are ready to go. You can change your URLs from

  http://your.host.name/some/path/and/file/names

to

  http://your.host.name/cgi-bin/zcat?/some/path/and/file/names

zcat is quite intelligent. It understands request like

  ~user/foo.html

  /lib/test.html

  /global/bar

It will reject requests that don't start with '/' or '~'. It will detect
directories and append 'index.html'. It will reject requests with '../'
in it somewhere so nobody can request ~leitner/../../../etc/passwd. If
the request starts with a '~', the user's public_html is used. If the
request starts with a '/', your server's htdocs directory is prepended.
Both are configurable in zcat.

zcat will try to append ".html" if it can't find a request. It will try
request, request.gz, request.html and request.html.gz. I like my script
and I am quite satisfied with it. I like mail !  Send me a mail if you
like zcat or you think you found a bug or have something to remark.

If you don't trust zcat enough, you can test it from your shell, just
call it with the name of the URL you want zcat to try to show. The
"Content-type: text/html" message you get is not a bug. cgi-bin's are
supposed to output that. That's the one thing I might enhance someday.
Someone might want so send something different than html text through
gzip. Everything you send through this script is interpreted as html.

Have fun !

Felix

PS: My mail address is leitner@inf.fu-berlin.de !
