BrettLee.com - CGIndex

  • @etPenguin.com
  • @Subversion-ViewVC
  • @Subversion
  • README

  • Return ( Software )
    The purpose of this software package is to deliver a simple way to provide custom directory listings.

    Below are some examples of how the directory indexing looks and works:

    Click Here --->  ** FILES & DIRECTORIES **

    Click Here --->  ** PHOTOS w/ THUMBNAILS **

    This began when I wanted a different look for my default Apache directory listing. In looking closer at Apache's Directory Listings there is "Fancy Indexing," but for me that was not really what I wanted.

    Looking elsewhere there was:

    1. Interesting support for CSS in LIGHTTPD via "mod_dirlisting"
    2. Seemingly convoluted ways using JavaScript and CSS
    3. A plethera of PHP scripts, all of which seemed to require traversal of the filesystem via the root

    So I set out to write my own, basing it on the standard Apache directive, DirectoryIndex.

    Using DirectoryIndex, append a CGI script (/cgi-bin/CGIndex.cgi) to the parameter list, and now there is a custom directory index. All that is left is to write a standard header and footer (called by the script), and all the pages look as desired. In my case I use some OS specific icons for each file to make it more intuitive what the files are with a quick glance.

    After this was working, I soon realized that for my directories of photos, a nice enhancement would be to display a thumbnail alongside the filename. So, the script also checks to see if a matching filename exists in a relative "thumbnail" directory, and if found, displays it instead of the icon. Naturally, a Perl script to recursively create thumbnails can be found with the CGIndex file at etPenguin.com.





    [ Powered by Red Hat Linux ] [ Powered by Apache Server] [ Powered by MySQL ]