Mailing List Archive

handler mayhem
Hello everyone...

I was hoping that someone could take a look at some handler configurations
I'm setting and tell me what's wrong with them.

The issue is that the file "htsearch" which is identified with the
URI /cgi-bin/htsearch is being handled by SW::Menu::Wrapper (I've
confirmed this with some good old fashioned "print STDERR ..." in
the error logs) and _not_ by cgi-handler, as ScriptAlias would
have you believe.

What the browser is returning is the binary-in-the-browser-window
of 'htsearch', a compiled C cgi program of the "htdig" collection.

Ideas? (note: I have tried dozens of variations on the themes
below, and they all yield exactly the same results, so I'm just
providing the most stripped down conf info here)

Thanks,
Richard

===============================================================
<Perl>
use Apache::Filter;
unshift @INC, "$ENV{'PROJECT_DIR'}/libs";
</Perl>

ScriptAlias /cgi-bin/ "/home/Projects/sw-web/devel/rdice/cgi-bin/"

<FilesMatch "\.html$">
SetHandler perl-script
PerlHandler SW::Menu::Wrapper SW::Filter::Gzip
</FilesMatch>

ErrorDocument 404 /DocumentNotFound.html
===============================================================

-------------------------------------------------------------------------
Richard Dice * Personal 514 816 9568 * Fax 514 816 9569
Open Source Evangelist, HBE Software * http://www.hbesoftware.com
ShadNet Creator * http://shadnet.shad.ca/ * rdice@shadnet.shad.ca
Occasional Writer, HotWired * http://www.hotwired.com/webmonkey/
"squeeze the world 'til it's small enough to join us heel to toe"
- jesus jones
Re: handler mayhem [ In reply to ]
> You might have more success with something like mod_ecgi (Eagle Book
> p675) than with mod_cgi because you are giving a compiled program to
> something that's expecting a script, which is text.

Since when does cgi-handler expect a text script? {Maybe since
forever and I've simply puffed too much of the whacky tobaccy}

> mod_ecgi so I've no idea if it's still supported, nor if it works with
> precompiled scripts. There are so many imponderables, I'd doubt it!

"Precompiled scripts" -- do you mean binaries? :-)

> The <FilesMatch "\.html$"> directive will do nothing for files that
> don't end with the five characters ".html", so they won't tell your
> system anything about something called "htsearch".

I agree! And yet... it does! I put a tiny bit of code into
SW::Menu::Wrapper (a mod_perl module written by Phillipe (another guy
here) and hacked on a fair bit by me) that writes a tiny bit of
text to error_log every time it is accessed... and it is accessed when
"htsearch" is called. This makes no sense to me.

Oh... I may as well share my server configs here...

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[rdice@berg libs]$ telnet berg 8545
Trying 192.168.1.156...
Connected to berg.hardboiledegg.com.
Escape character is '^]'.
HEAD / HTTP/1.1
Host: berg:8545

HTTP/1.1 200 OK
Date: Thu, 24 Feb 2000 20:47:45 GMT
Server: Apache/1.3.12-dev (Unix) mod_perl/1.21_01-dev
Vary: User-Agent,Accept-Encoding
Connection: close
Content-Type: text/html
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Yeah, it's bleeding edge... that's the way Phillipe likes it. :-)

> You need something like this in httpd.conf (depending on your users
> you may need something to tell Apache about permissions for the
> directory too):
>
> <Directory /usr/local/apache/cgi-bin>
> AllowOverride None
> Options ExecCGI Includes
> </Directory>

I had something like that. It made no difference -- the binary
file was displayed even with this. I took it out for the sake of
easier posting to this mailing list, asking for help with "the minimal
case", etc.

Thanks for the input... looking forward to seeing the emails stew
on this one... :-)

Cheers,
Richard

-------------------------------------------------------------------------
Richard Dice * Personal 514 816 9568 * Fax 514 816 9569
Open Source Evangelist, HBE Software * http://www.hbesoftware.com
ShadNet Creator * http://shadnet.shad.ca/ * rdice@shadnet.shad.ca
Occasional Writer, HotWired * http://www.hotwired.com/webmonkey/
"squeeze the world 'til it's small enough to join us heel to toe"
- jesus jones