ectoplasm.org logo perl icon
previous page: X::Osd - Perl extension to the X On Screen Display library (xosd)page up: Softwareno next page


Apache::AutoIndex - Perl replacment for mod_autoindex and mod_dir Apache module







Google


/.

ApacheCon Speaker


My Amazon.com Wish List


Table of Contents

SYNOPSIS

  PerlModule Apache::Icon
  PerlModule Apache::AutoIndex
  (PerlModule Image::Magick) optionnal
  PerlTransHandler Apache::AutoIndex::transhandler
  PerlHandler Apache::AutoIndex


TOP

DESCRIPTION

This module can replace completely mod_dir and mod_autoindex standard directory handling modules shipped with apache. It can currently live right on top of those modules, but I suggest simply making a new httpd without these modules compiled-in.

To start using it on your site right away, simply preload Apache::Icon and Apache::AutoIndex either with:

  PerlModule Apache::Icon
  PerlModule Apache::AutoIndex

in your httpd.conf file or with:

   use Apache::Icon ();
   use Apache::AutoIndex;

in your require.pl file.

Then it's simply adding

    PerlTransHandler Apache::Autoindex::transhandler
    PerlHandler Apache::AutoIndex

somewhere in your httpd.conf but outside any Location/Directory containers.



TOP

VIRTUAL HOSTS

If used in a server using virtual hosts, since mod_perl doesn't have configuration merging routine for virtual hosts, you'll have to put the PerlHandler and PerlTransHandler directives in each and every <VHOST></VHOST> section you wish to use Apache::AutoIndex with.



TOP

DIRECTIVES

It uses all of the Configuration Directives defined by mod_dir and mod_autoindex.

Since the documentation about all those directives can be found on the apache website at:

 http://www.apache.org/docs/mod/mod_autoindex.html 
 http://www.apache.org/docs/mod/mod_dir.html

I will only list modification that might have occured in this perl version.



TOP

SUPPORTED DIRECTIVES



TOP

NEW DIRECTIVES



TOP

UNSUPPORTED DIRECTIVES



TOP

THUMBNAILS

Since version 0.07, generation of thumbnails is possible. This means that listing a directory that contains images can be listed with little reduced thumbnails beside each image name instead of the standard 'image' icon.

To enable this you simply need to preload Image::Macick in Apache. The IndexOption option Thumbnails controls thumbnails generation for specific directories like any other IndexOption directive.



TOP

USAGE

The way thumbnails are generated/produced can be configured in many ways, but here is a general overview of the procedure.

For each directory containing pictures, there will be a .thumbnails directory in it that will hold the thumbnails. Each time the directory is accessed, and if thumbnail generation is active, small thumbnails will be produced, shown beside each image name, instaed of the normal , generic, image icon.

That can be done in 2 ways. In the case the image is pretty small, no actual thumbnail will be created. Instead the image will be resized with the HEIGHT and WIDTH attributes of the IMG tag.

If the image is big enough, it is resized with Image::Magick and saved in the .thumbnails directory for the next requests.

Change in the configuration of the indexing options will correctly refresh the thumbnails stored. Also if an original image is modified, the thumbnail will be modified accordingly. Still, the browser might screw things up if it preserves the cached images.

The behaviour of the Thumbnail generating code can be customized with these PerlSetVar variables:



TOP

TODO

The transhandler problem should be fixed.

Some minor changes to the thumbnails options will still have the thumbnails re-generated. This should be avoided by checking the attributes of the already existing thumbnail.

Some form of garbage collection should be performed or cache directories will fill up.

Find new things to add...



TOP

SEE ALSO

perl(1), Apache(3), Apache::Icon(3), Image::Magick(3) .



TOP

SUPPORT

Please send any questions or comments to the Apache modperl mailing list <modperl@apache.org> or to me at <ozer@cpan.org>



TOP

NOTES

This code was made possible by :



TOP

AUTHOR

Philippe M. Chiasson <gozer@cpan.org>



TOP

CVS The CVS repository of Apache::AutoIndex is avaliabe thru anoncvs at:

     $> cvs -d :pserver:anoncvs@cvs.ectoplasm.org:/home/anoncvs login
     password: anoncvs
     $> cvs -d :pserver:anoncvs@cvs.ectoplasm.org:/home/anoncvs co Apache-AutoIndex


TOP

COPYRIGHT

Copyright (c) 1999-2003 Philippe M. Chiasson. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.






TOP
previous page: X::Osd - Perl extension to the X On Screen Display library (xosd)page up: Softwareno next page