You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Coexec <co...@yahoo.com> on 2003/08/11 17:37:19 UTC
Mod_perl how to include the result of mod_autoindex?
I am writing a mod_perl script using CGI.pm and Apache
1.3.28/Linux.
I am trying to figure out how to use Apache's
mod_autoindex to display a directories contents within
the output the CGI. Apache is configured correctly, I
am not asking for Apache help.
The end user will submit a form. One of the values in
that form will be a path on the local web server. So
in the return of the CGI, I want to include the
results of Apache's autoindex. I cannot figure out
how to do it. If I could pass a variable from a CGI
to an SSI, the problem would be solved, but I do not
believe that it is possible. I have been looking at
Apache::SSI and Apache::AutoIndex but I don't think I
can get them to do what I need. Does anyone have any
suggestions or recommendations?
Anything will be much appreciated.
Thanks,
Matt
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
Re: Mod_perl how to include the result of mod_autoindex?
Posted by Christopher Grau <ch...@chrisgrau.com>.
On Mon, Aug 11, 2003 at 08:37:19AM -0700, Coexec wrote:
> The end user will submit a form. One of the values in
> that form will be a path on the local web server. So
> in the return of the CGI, I want to include the
> results of Apache's autoindex. I cannot figure out
> how to do it. If I could pass a variable from a CGI
> to an SSI, the problem would be solved, but I do not
> believe that it is possible. I have been looking at
> Apache::SSI and Apache::AutoIndex but I don't think I
> can get them to do what I need. Does anyone have any
> suggestions or recommendations?
You could probably issue a subrequest in a CGI program running under
Apache::Registry, though I'm unsure how to go about capturing the output
of a subrequest. However, it would probably be easier to use
Apache::Filter with your own Perl handler:
PerlModule Apache::Filter
PerlModule Apache::Icon
PerlModule Apache::AutoIndex
PerlModule Apache::MyHandler
<Location /addindex>
PerlSetVar Filter On
SetHandler perl-script
PerlTransHandler Apache::AutoIndex::transhandler
PerlHandler Apache::AutoIndex Apache::MyHandler
</Location>
Then your handler can take the output of Apache::AutoIndex and do whatever
it likes to it in the same manner as Apache::SSI. The perldoc for
Apache::Filter shows you just how to do this.
-chris
Re: Mod_perl how to include the result of mod_autoindex?
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
Thomas Klausner wrote:
> Hi!
>
> On Mon, Aug 11, 2003 at 04:37:45 -0500, Slava Bizyayev wrote:
>
>>It's not quite the truth...
>>You can do all that staff on Apache 1.3 with appropriate skills. See LWP
>>for example.
>
>
> If you mean to grab the output of e.g. mod_autoindex by issueing a sperate
> request using LWP, that's definitly possible. But I would classify this as a
> "hack" and not as a proper way to implement a feature.
and it's perl - as you had said, if you stay within perl's boundaries, much
more is possible :)
>
> Or /is/ there a clean way to properly filter output from different response
> handlers with Apache 1.3? I'd realy like to hear about it...
>
mod_gzip apparently does this, though I've never evaluated the code or how
they do it.
http://www.schroepl.net/projekte/mod_gzip/
which is why I generally say "filtering content is impossible in 1.3 (well,
really, really hard)"
--Geoff
Re: Mod_perl how to include the result of mod_autoindex?
Posted by Thomas Klausner <do...@zsi.at>.
Hi!
On Mon, Aug 11, 2003 at 04:37:45 -0500, Slava Bizyayev wrote:
> It's not quite the truth...
> You can do all that staff on Apache 1.3 with appropriate skills. See LWP
> for example.
If you mean to grab the output of e.g. mod_autoindex by issueing a sperate
request using LWP, that's definitly possible. But I would classify this as a
"hack" and not as a proper way to implement a feature.
Or /is/ there a clean way to properly filter output from different response
handlers with Apache 1.3? I'd realy like to hear about it...
--
#!/usr/bin/perl http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}
Re: Mod_perl how to include the result of mod_autoindex?
Posted by Slava Bizyayev <sb...@outlook.net>.
It's not quite the truth...
You can do all that staff on Apache 1.3 with appropriate skills. See LWP
for example.
Thanks,
Slava
On Mon, 2003-08-11 at 14:06, Thomas Klausner wrote:
> Hi!
>
> On Mon, Aug 11, 2003 at 08:37:19AM -0700, Coexec wrote:
> > I am writing a mod_perl script using CGI.pm and Apache
> > 1.3.28/Linux.
> >
> > I am trying to figure out how to use Apache's
> > mod_autoindex to display a directories contents within
> > the output the CGI. Apache is configured correctly, I
> > am not asking for Apache help.
>
> This is not possible using Apache 1.3. What you want to do is called
> "filtering" and is available with Apache/mod_perl 2.0.
>
> http://perl.apache.org/docs/2.0/user/intro/overview.html#Integration_with_2_0_Filtering
>
> With Apache 1.3, you cannot (e.g.) generate content with mod_perl that
> includes Server-Side-Include directives. You also cannot get the content of
> mod_autoindex and further process this content using something.
>
> What does work is to use only mod_perl, as suggested by Christopher Grau
Re: Mod_perl how to include the result of mod_autoindex?
Posted by Thomas Klausner <do...@zsi.at>.
Hi!
On Mon, Aug 11, 2003 at 08:37:19AM -0700, Coexec wrote:
> I am writing a mod_perl script using CGI.pm and Apache
> 1.3.28/Linux.
>
> I am trying to figure out how to use Apache's
> mod_autoindex to display a directories contents within
> the output the CGI. Apache is configured correctly, I
> am not asking for Apache help.
This is not possible using Apache 1.3. What you want to do is called
"filtering" and is available with Apache/mod_perl 2.0.
http://perl.apache.org/docs/2.0/user/intro/overview.html#Integration_with_2_0_Filtering
With Apache 1.3, you cannot (e.g.) generate content with mod_perl that
includes Server-Side-Include directives. You also cannot get the content of
mod_autoindex and further process this content using something.
What does work is to use only mod_perl, as suggested by Christopher Grau
--
#!/usr/bin/perl http://domm.zsi.at
for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}