Fix for cvsweb.cgi to run propertly in ModPerl::PerlRun
Craig Manley
cmanley at xs4all.nl
Sat Apr 1 20:50:26 UTC 2006
Hi,
ModPerl::Registry and ModPerl::PerlRun run scripts require these lines
in order for warn's and die's to work as they do in CGI mode:
$ENV{'MOD_PERL_API_VERSION'} && ($ENV{'MOD_PERL_API_VERSION'} >= 2) &&
(local $SIG{__WARN__} = \&Apache2::ServerRec::warn);
$ENV{'MOD_PERL_API_VERSION'} && ($ENV{'MOD_PERL_API_VERSION'} >= 2) &&
(local $SIG{__DIE__} = \&Apache2::ServerRec::die);
If you don't use the above, Perl warnings won't appear in the error_log.
I'm running my cvsweb.cgi in ModPerl::PerlRun because I can't softlink
to a shared cgi script from an apache ScriptAlias'ed directory or
mod_cgi script for some paranoid reason. In ModPerl::PerlRun this is
possible. This is my .htaccess file for those who are interested in
trying this:
<FilesMatch "^(cvsweb\.conf|cvsrepos)$">
// I have a copied cvs repository here that root copies for me
from a pserver-cvs's
// repository (setting privileges and ownerships straight in the
process).
// If you want the script let me know.
deny from all
</FilesMatch>
Options +FollowSymLinks
DirectoryIndex cvsweb.cgi
<FilesMatch "\.cgi$">
SetHandler perl-script
PerlResponseHandler ModPerl::PerlRun
PerlOptions +ParseHeaders
Options +ExecCGI
</FilesMatch>
Another problem that I'll try to fix is to make cvsweb.cgi extract it's
relative path and prepend that to the css and icon URL's if they are
relative. I'm using cvsweb.cgi and all it's related files in a single
subdirectory of the document root.
-Craig Manley.
More information about the freebsd-cvsweb
mailing list