Philippe M. Chiasson > Apache-AutoIndex-0.08 > Apache::AutoIndex

Download:
Apache-AutoIndex-0.08.tar.gz

Dependencies

Annotate this POD

Related Modules

Apache::Constants
File::Cache
more...
By perlmonks.org
View/Report Bugs
Module Version: 0.08   Source  

NAME ^

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

SYNOPSIS ^

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

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.

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.

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.

SUPPORTED DIRECTIVES

NEW DIRECTIVES

UNSUPPORTED DIRECTIVES

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.

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:

DIRECTIVES

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...

SEE ALSO ^

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

SUPPORT ^

Please send any questions or comments to the Apache modperl mailing list <modperl@apache.org> or to me at <gozer@ectoplasm.dyndns.com>

NOTES ^

This code was made possible by :

Doug MacEachern

<dougm@pobox.com> Creator of Apache::Icon, and of course, mod_perl.

Rob McCool

who produced the final mod_autoindex.c I copied, hrm.., well, translated to perl.

The mod_perl mailing-list

at <modperl@apache.org> for all your mod_perl related problems.

AUTHOR ^

Philippe M. Chiasson <gozer@ectoplasm.dyndns.com>

COPYRIGHT ^

Copyright (c) 1999 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.

syntax highlighting: