
Apache2::CPAN::Query - mod_perl interface to CPAN::Search::Lite::Query

This module provides a mod_perl (2) interface to CPAN::Search::Lite::Query.
The modules Apache2::Request and Apache2::Cookie of the libapreq2 distribution are required.
A directive
PerlLoadModule Apache2::CPAN::Query
should appear before any of the Location directives using the module. As well, the following directives should be defined in the Apache configuration file.
CSL_db databasethe name of the database [required]
CSL_user userthe user to connect to the database as [required]
CSL_passwd passwordthe password to use for this user [optional if no password is required for the user specified in CSL_user.]
CSL_tt2 /path/to/tt2the path to the tt2 pages [required].
CSL_dl http://www.cpan.orgthe default download location [optional - http://www.cpan.org will be used if not specified]
CSL_max_results 200the maximum number of results to obtain [optional - 200 will be used if not specified]
CSL_html_root /usr/local/httpd/CPANthe path to the local html docs [required for the perldoc handler]
CSL_html_uri http://you.org/CPAN/docsthe uri to use for the html docs [required for the perldoc handler]
Available response handlers are as follows.
<Location "/search"> SetHandler perl-script PerlResponseHandler Apache2::CPAN::Query->search </Location>
This handles search queries such as for http://localhost/search?mode=dist;query=libnet. mode can be one of dist, module, or author. A search using the specified query will be done on, respectively, distribution names and abstracts, module names and abstracts, and CPAN ids and full names.
<LocationMatch "/~[A-Za-z0-9-]+"> SetHandler perl-script PerlResponseHandler Apache2::CPAN::Query->cpanid </LocationMatch>
There are two levels:
This will bring up a page of information on the author whose cpanid is CPANID.
This will bring up a page of information on the distribution Dist-Name of cpanid CPANID.
<Location "/author"> SetHandler perl-script PerlResponseHandler Apache2::CPAN::Query->author </Location>
There are 3 levels:
This brings up a menu of letters of the alphabet to link to authors whose ids begin with that letter.
This brings up an information page for the author with cpanid CPANID.
This brings up a list of all authors whose cpanids begin with A.
<Location "/dist"> SetHandler perl-script PerlResponseHandler Apache2::CPAN::Query->dist </Location>
There are 4 levels:
This brings up a menu of letters of the alphabet to link to distributions whose names begin with that letter.
This brings up an information page for the distribution with name Dist-Name.
This brings up a list of all distributions whose names begin with A.
This brings up a list of all distributions whose names match ABC-*.
<Location "/module"> SetHandler perl-script PerlResponseHandler Apache2::CPAN::Query->module </Location>
There are 4 levels:
This brings up a menu of letters of the alphabet to link to mocules whose names begin with that letter.
This brings up an information page for the module with name Mod::Name.
This brings up a list of all modules whose names begin with A.
This brings up a list of all modules whose names match ABC::*.
<Location "/chapter"> SetHandler perl-script PerlResponseHandler Apache2::CPAN::Query->chapter </Location>
There are 3 levels:
This brings up a menu of all available chapter headings (as appears in %chaps of CPAN::Search::Lite::Util).
This brings up a list all subchapters of the Data Type Utilities chapter.
This brings up a list of all distributions in the Tie subchapter of the Data Type Utilities chapter.
<Location "/recent"> SetHandler perl-script PerlResponseHandler Apache2::CPAN::Query->recent </Location>
With this, a request for http://localhost/recent will list all distributions uploaded in the last 7 days.
<Location "/mirror"> SetHandler perl-script PerlResponseHandler Apache2::CPAN::Query->mirror </Location>
With this, a request for http://localhost/mirror will bring up a page whereby the user can change the location of where downloads will be redirected to. This requires cookies to be enabled.
<Location "/perldoc"> SetHandler perl-script PerlResponseHandler Apache2::CPAN::Query->perldoc </Location>
With this, a request for, eg, http://localhost/perldoc/perlfaq will be redirected to the perfaq documentation, and a request for, eg, http://localhost/perldoc/Net::FTP, will be redirected to the documentation for Net::FTP.

Apache2::CPAN::Search, CPAN::Search::Lite::Query, and mod_perl.