Re: [mp2] +Parent and -Mblib breaks AuthDBI and apache
On Thu, 30 Jan 2003, Stas Bekman wrote: > Christopher Hicks wrote: > > Is there any equivalent to PerlVINC under mod_perl 2? > > Yes, and it's a built-in solution, rather than a hack: > http://perl.apache.org/docs/2.0/user/config/config.html#C_Parent_ That had me very hopeful, but upon trying it PerlOptions +Parent +SetupEnv PerlSwitches -Mblib=/www/ires-demo/ I continue to get: Cannot find blib even in /www/ires-demo/../../../../.. BEGIN failed--compilation aborted. perl_parse: No such file or directory I've read the blib man page a few times and tried to discern what directory structure is expected from looking at a few MakeMaker-based modules, but nothing seems to help. There's a directory in /www/ires-demo/perllib that's a working perl modules directory. It works in several cgi and command line scripts via use lib. Pointing -Mblib directly at the perllib directory and the directory above it do no good. Putting a symlink from lib to perllib also did no good. The other fun was that the previously working AuthDBI is now no longer found with +Parent. This happens regardless of the presense of -Mblib. I've looked for the t/REPORT script, but Red Hat doesn't seem kind enough to include it, so I'll try to provide salient details: [root@dot conf]# rpm -qa | egrep 'mod_perl|httpd|perl-5' perl-libwww-perl-5.65-2 mod_perl-1.99_05-3 perl-5.8.0-55 httpd-2.0.40-11 httpd-manual-2.0.40-11 redhat-config-httpd-1.0.1-13 httpd-devel-2.0.40-11 [root@dot conf]# httpd -V Server version: Apache/2.0.40 Server built: Oct 9 2002 08:01:13 Server's Module Magic Number: 20020628:0 Architecture: 32-bit Server compiled with -D APACHE_MPM_DIR="server/mpm/prefork" -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D APR_HAVE_IPV6 -D APR_USE_SYSVSEM_SERIALIZE -D APR_USE_PTHREAD_SERIALIZE -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT -D APR_HAS_OTHER_CHILD -D AP_HAVE_RELIABLE_PIPED_LOGS -D HTTPD_ROOT="/etc/httpd" -D SUEXEC_BIN="/usr/sbin/suexec" -D DEFAULT_PIDLOG="logs/httpd.pid" -D DEFAULT_SCOREBOARD="logs/apache_runtime_status" -D DEFAULT_LOCKFILE="logs/accept.lock" -D DEFAULT_ERRORLOG="logs/error_log" -D AP_TYPES_CONFIG_FILE="conf/mime.types" -D SERVER_CONFIG_FILE="conf/httpd.conf" -- "Never offend people with style when you can offend them with substance." - Sam Brown
[mp2] no PerlVINC?
Is there any equivalent to PerlVINC under mod_perl 2? -- "Never offend people with style when you can offend them with substance." - Sam Brown
[mp2] AuthDBI breaking with RH httpd-2.0.40-11 rpm
I brought a new server up yesterday using Red Hat 8's httpd-2.0.40-8 and based on the patches and comments I found in the list archive all was eventually well. Today I updated various rpms on the box from the official Red Hat updates and how AuthDBI is no longer working. I stuck various debugging statements in until I drilled down to the point of finding that crypt() seems to be the problem. Running perl from the command line produces correct results: # perl -e 'print crypt("test","0y"),"\n"'; 0y5fZG4UG8Bd. but when I add the logging statement into AuthDBI $r->log_reason("password='$password' passwd_to_check='$passwd_to_check' salt='$salt' accessing ", $r->uri); between these lines: my $passwd_to_check = $Attr->{encrypted} eq 'on' ? crypt($passwd_sent, $password) : $passwd_sent; # here in other words if ($passwd_to_check eq $password) { the logs show: [Fri Jan 24 16:27:19 2003] [error] password='0y5fZG4UG8Bd.' passwd_to_check='0ypz5H80XtTxw' salt='0y' accessing /cgi/test So why did upgrading httpd break crypt?!? -- "Never offend people with style when you can offend them with substance." - Sam Brown
Apache configuration
I've heard lots of people talking about doing Apache configuration via sections and mod_perl, but I can't find any examples! I've looked on Sourceforge, the Guide, and dug through google. The Eagle book has the best stuff I've found so far, but it's hard for me to believe that noone has done anything with it since then. Any pointers? -- Neither sweat, nor blood, nor frustration, or lousy manuals nor missing parts, or wrong parts shall keep me from my task.
Apache::SSI pain
I've used the lines below and the various other provided incantations for using Apache::SSI or Apache::SSIChain. PerlModule Apache::SSIChain PerlModule Apache::Filter PerlModule Apache::SSI PerlModule Apache::OutputChain Alias /ssiperl/ /www/perl/ssibin/ SetHandler perl-script # PerlSendHeader On PerlSetVar Filter On # PerlHandler Apache::OutputChain Apache::SSIChain Apache::Registry # PerlHandler Apache::SSIChain Apache::Registry PerlHandler Apache::Registry Apache::SSI Options +ExecCGI The SSI's get included, but they're all at the top of the file. Both of the PerlHandler lines commented out above have SSIChain as the last thing which is what the docs say to do. But the includes still get included before the rest of the file. I've scoured the modperl archives. I've read through the source and documentation to Apache::SSI*. Does anyone have any ideas? My workaround: sub processSSI { my ($text,$r) = @_; my @lines = split(/\n/,$text); my ($line,@el,$command,$key,$val,%param); foreach $line (@lines) { if ($line =~ //) { @el = split(/\s+/,$1); $command = lc(shift(@el)); foreach (@el) { ($key,$val) = split(/=/); $key = lc($key); # lower case key # strip double quotes if they're there # and balanced if (substr($val,0,1) eq '"') { if (substr($val,-1,1) eq '"') { chop($val); substr($val,0,1) = ''; } } $param{$key}=$val; } if ($command eq "include") { if (defined( $param{'virtual'} )) { Apache::Include->virtual($param{'virtual'}); } } } else { print $line, "\n"; } } } This handles my needs. It is a disadvantage to be stuck with putting anything that isn't an "include virtual" into a file which is then called via an "include virtual". But at least it works. -- "The only thing more frightening than a programmer with a screwdriver or a hardware enginner with a program is a user with wire cutters and the root password."- Elizabeth Zwicky