Greetings,
I wanted to set up apache so that when it generates a directory
listing, there's a link before the listing that includes the directory
name, i.e., is dynamically generated.
As far as I can tell, this means getting Apache to execute a CGI when
creating the listing, and again as far as I can tell, it won't. I'm
using apache 2.0.50 (compiled myself) under Red Hat WS 2.1.
Following the advice at the Apache documentation:
http://httpd.apache.org/docs-2.0/mod/mod_autoindex.html
I tried setting text/html (and text/plain) as the file type for
..cgi's:
HeaderName /try.cgi
AddType text/html .cgi
This inserts the source of the cgi in the directory listing, rather
than the output.
The cgi's run fine when executed normally, i.e.,
http://myhost/try.cgi
runs and displays the output.
I tried other variations: using a /cgi-bin (aka ScriptAlias)
directory, IndexOptions +SuppressHTMLPreamble, mod_rewrite, etc.
Either there was no output at all, or the script source was inserted.
I looked at the mod_autoindex.c source. I see no special case for cgi
there, although I guess that doesn't prove anything one way or
another.
Any advice gratefully received. Please email me if possible.
Thanks,
karl.DeleteThis@tug.org