I want a way to produce a web page which includes directory contents like those produced by apache's mod_autoindex.
Looking at the apache documentation I can't see any obvious way to do this, it either displays the contents of index.html (if that's what you have set with the DirectoryIndex directive) or it will (if allowed) do what mod_autoindex is configured to do and show you the contents of the directory. I want to be able to ask for something like http://my.site.com/dira/index.html and see what's in index.html *plus* clickable links for each of the files in dira.
The HEADER.html and README.html files set by the HeaderName and ReadmeName directives don't quite do what I want (though nearly).
Has anyone any ideas or pointers to anything useful.
Ultimately what I want is a way to have a directory where I can have a reST generated index.html file and then a list of .PDF (for example) files that can be clicked on. I don't particularly want to have to edit the index.html every time I add or delete a .PDF file. Note, it's not *just* for PDF files but it's probably for a fairly short list of file types.
Eur Ing Chris Green wrote:
Ultimately what I want is a way to have a directory where I can have a reST generated index.html file and then a list of .PDF (for example) files that can be clicked on. I don't particularly want to have to edit the index.html every time I add or delete a .PDF file. Note, it's not *just* for PDF files but it's probably for a fairly short list of file types.
If you want the list of files to appear as a dynamic part of the index file, then you could knock up a small Python or Perl script (to get the list of directory entries you are interested in) and embed it as a server-side include. All you need to do is configure Apache to process your index file as an SSI, e.g. (from memory):
<Directory /home/httpd/whatever> Options ExecCGI Includes AddHandler server-parsed .shtml </Directory>
and then add something like
<html><head><title>My Index Page</title></head> <body> <h1>Content</h1> <p>Some stuff</p> <h1>Files</h1>
<!--#set var="locn" value="/my/current/directory"--> <!--#exec cgi="/cgi-bin/listfiles.py"-->"
</body>
where you want your list to appear. The #set passes the cwd as a CGI param which your script can query.
Cheers, Simon
On Thu, Mar 08, 2007 at 02:38:13PM +0000, Simon Ransome wrote:
Eur Ing Chris Green wrote:
Ultimately what I want is a way to have a directory where I can have a reST generated index.html file and then a list of .PDF (for example) files that can be clicked on. I don't particularly want to have to edit the index.html every time I add or delete a .PDF file. Note, it's not *just* for PDF files but it's probably for a fairly short list of file types.
If you want the list of files to appear as a dynamic part of the index file, then you could knock up a small Python or Perl script (to get the list of directory entries you are interested in) and embed it as a server-side include. All you need to do is configure Apache to process your index file as an SSI, e.g. (from memory):
[snip]
Yes, I think I'm coming to the conclusion that's the only way to do it, thanks.