Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 01 Apr 2006 22:50:41 +0200
From:      Craig Manley <cmanley@xs4all.nl>
To:        freebsd-cvsweb@freebsd.org
Subject:   Fix for cvsweb.cgi to run propertly in ModPerl::PerlRun
Message-ID:  <442EE7A1.20106@xs4all.nl>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?442EE7A1.20106>