Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

mod_autoindex and cgi generation

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  Apache change SSL certificate  
Author Message
karl3

External


Since: Sep 05, 2004
Posts: 1



(Msg. 1) Posted: Sun Sep 05, 2004 5:41 pm
Post subject: mod_autoindex and cgi generation
Archived from groups: alt>apache>configuration (more info?)

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

 >> Stay informed about: mod_autoindex and cgi generation 
Back to top
Login to vote
kalvaronospamt

External


Since: Feb 25, 2004
Posts: 58



(Msg. 2) Posted: Mon Sep 06, 2004 3:08 am
Post subject: Re: mod_autoindex and cgi generation [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

*** karl berry escribió/wrote (5 Sep 2004 14:41:30 -0700):
 > Following the advice at the Apache documentation:
<font color=purple> > <a style='text-decoration: underline;' href="http://httpd.apache.org/docs-2.0/mod/mod_autoindex.html</font" target="_blank">http://httpd.apache.org/docs-2.0/mod/mod_autoindex.html</font</a>>
 > 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.

That manual page is pretty confusing, at least for someone like me who's
mother tongue isn't English Smile

What I've found through testing is that you can use a server-parsed file
(*.shtml) as header. That file can use SSI tags to include other files, for
example a PHP script. This way the script gets executed:

::: .htaccess

HeaderName /header.shtml


::: header.shtml

<!--#include file="test.php" -->


::: test.php

<?
echo 'Hello, world!";
?>



For whatever the reason, you can't do this:

HeaderName /test.php




--
-+ Álvaro G. Vicario - Burgos, Spain
+- <a style='text-decoration: underline;' href="http://www.demogracia.com" target="_blank">http://www.demogracia.com</a> (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: mod_autoindex and cgi generation 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Generation of SSL certificate. - Hi group, I've got Apache 1.3.31 installed and by default it didn't installed SSL. I had to install it manually. Now I need to configure SSL, starting for the creation of certificates, private keys, etc. I'd read a document that explains how to create a...
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]