Re: Problem using Perl Modules under mod_perl / PerlSetVar not working
Nope, using: Alias /contest /www/u-dev/contest PerlModule Apache::Registry PerlModule Apache::DBI PerlTaintCheck On Location /contest SetHandler perl-script PerlHandler Apache::Registry PerlSetVar BlaTest BlaVal PerlRequire /www/u-dev/contest/mod_perl_init.pl Options ExecCGI PerlSendHeader Off allow from all /Location doesn't work any better... As the folks said you need to use $r-dir_config if you want to pull the Location specific value. Does this mean I have to add this to my scripts directly and can't do it at Server-Startup in my startup.pl? Regards Soeren -- netendance GmbH Sören Stuckenbrock Fränkische Straße 38 30455 Hannover Telefon: 49 (0) 511/4733773 Fax: 49 (0) 511/4733776 Mobil : 49 (0) 173/6000319 http://www.netendance.de
reverseproxy configuration
hi i am trying to set up a front end vanilla + backend modperl server with mod_proxy the front end server (apache2)works ok on port 80, the back end works (apache mod_perl 1) ok on port 8080, but each time the url is redirected to the backend server i get a forbidden response even though i put allow from all for everything in the front end . the front end conf is something like this directory / allow from all/directory ProxyRequests Off ProxyPass /stylesheets ! ProxyPass /icons ! ProxyPass /evolif http://localhost:8080/evolif RewriteEngine On RewriteRule (^.*\.pl)$ http://localhost:8080$1 [proxy,last] ProxyPassReverse / http://localhost:8080/ ProxyReceiveBufferSize 49152 the back end conf is set on port 8080 and works perfectly by itself if I specify :8080 in the url. the reverse proxy setting is explained everywhere, but only allusions is made to access rights that goes with it. I looked in the apache docs, in mod_perl guide, but found no practical working example that explains about how to set access rights, after the reverseproxy setting, especially when the back-end is to serve generated on the fly document and not a file on disk. thanks for any help pascal Accédez au courrier électronique de La Poste : www.laposte.net ; 3615 LAPOSTENET (0,13 /mn) ; tél : 08 92 68 13 50 (0,34/mn)
Re: Problem using Perl Modules under mod_perl / PerlSetVar not working
Sören Stuckenbrock wrote: Nope, using: Alias /contest /www/u-dev/contest PerlModule Apache::Registry PerlModule Apache::DBI PerlTaintCheck On Location /contest SetHandler perl-script PerlHandler Apache::Registry PerlSetVar BlaTest BlaVal PerlRequire /www/u-dev/contest/mod_perl_init.pl Options ExecCGI PerlSendHeader Off allow from all /Location doesn't work any better... As the folks said you need to use $r-dir_config if you want to pull the Location specific value. Does this mean I have to add this to my scripts directly and can't do it at Server-Startup in my startup.pl? Those set in the Location aren't accessible via $s. A simple reason is in the following example: Location /A PerlSetVar BlaTest BlaValA /Location Location /B PerlSetVar BlaTest BlaValB /Location how $s is supposed to know which one do you want? So if you need to access dir_config at the server startup, you must define PerlSetVar at the top level (or vhost) and access with $s-dir_config() If you define within Location, you can only get to these at the request time. Another possible workaround is to use Perl to create the configuration and in this case you can do whatever you want with the configuration hash that you have created, as you can store and reuse that data at the startup or during the requests, see the configuration chapter in the guide. __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: [OT] Doubt on directories for development
F. Xavier Noria wrote: The fact is that developers in my team have Apache under /usr/local in Linux machines, but we would prefer to develop as normal users, not as www or nobody, though that will be the user in production. What is the standard way to configure things for that? We have created somehow the Apache directory layout under the root of the project tree and call httpd -f project_root/conf/httpd.conf, where we customize the user and group (in my case fxn), full paths to log and pid files writable by that user, etc. but ServerRoot is /usr/local/apache and the original modules under /usr/local/apache are there, so we cannot use $r-server_root_relative to access, say, to application config files which seems to be standard (and quite natural) idiom. The httpd.conf in CVS is a template customized once per-machine with a script. It doesn't seem worth it to me to go to a lot of trouble to avoid starting apache as root in development, especially if that's how you'll do it in production. I've always just put my modules in /usr/local/apache/lib/perl where they get picked up automatically (with no use lib or INC changes). I make that directory writeable by my standard login (a security hole, but it's just my personal machine and not visible on the Internet), and keep a root shell open for restarting the server. That works fine unless you have mutiple users developing on the same box. - Perrin
Re: [OT] Doubt on directories for development
The fact is that developers in my team have Apache under /usr/local in Linux machines, but we would prefer to develop as normal users, not as www or nobody, though that will be the user in production. See the section on configuring Apache using Perl sections in the eagle book. I normally use the approach of having each user's .*profile export APACHE_PORT and using $Port = $ENV{APACHE_PORT} or croak $$: Environment missing APACHE_PORT; for the user's config files. Using the nobody approach works well enough, but the separate ports allow developers to have their own server on a high-numbered port w/o stepping on one another. -- Steven Lembark 2930 W. Palmer Workhorse Computing Chicago, IL 60647 +1 800 762 1582
Re: [OT] Doubt on directories for development
* [EMAIL PROTECTED] [EMAIL PROTECTED] [2002-04-22 09:53]: The fact is that developers in my team have Apache under /usr/local in Linux machines, but we would prefer to develop as normal users, not as www or nobody, though that will be the user in production. See the section on configuring Apache using Perl sections in the eagle book. I normally use the approach of having each user's .*profile export APACHE_PORT and using $Port = $ENV{APACHE_PORT} or croak $$: Environment missing APACHE_PORT; for the user's config files. Using the nobody approach works well enough, but the separate ports allow developers to have their own server on a high-numbered port w/o stepping on one another. I like using something like the user's UID as the port on which to start Apache; with bash, at least, UID is automatically set. If not, something like: : ${UID:=`id | sed -e 's/uid=\([0-9]*\)(.*/\1/'`} in .profile will set it for the Bourne shell (don't know/care about csh). (darren) -- Men never do evil so completely and cheerfully as when they do it from religious conviction. -- Blaise Pascal
RE: Throttling, once again
Hi, Jeremy. I looked at the page you mentioned below. It wasn't really clear on the page, but what happens when the requests get above the max allowed? Are the remaining requests queued or are they simply given some kind of error message? The service will respond with an HTTP 503 message when the MaxConcurrentReqs number is reached. That tells the browser that the service is temporarily unavailable and to try again later. There seem to be a number of different modules for this kind of thing, but most of them seem to be fairly old. We could use a more currently throttling module that combines what others have come up with. Age shouldn't matter. If something works as designed, it doesn't need to be updated. :) For example, the snert.com mod_throttle is nice because it does it based on IP - but it does it site wide in that mode. This mod_throttle seems nice because it can be set for an individual URI...But that's a pain for sites like mine that have 50 or more intensive scripts (by directory would be nice). And still both of these approaches don't use cookies like some of the others to make sure that legit proxies aren't blocked. Well, the design goals of each are probably different. For instance, mod_throttle_access was designed to keep a service healthy, not punish a set of over-zealous users. Blocking by IP doesn't necessarily protect the health of your service. Also, you shouldn't rely on cookies to ensure the health of your service. If someone has cookies disabled, they can defeat your scheme. BTW, mod_throttle_access is a per-directory module (ie, by Directory, Location, or Files), so you can protect an entire tree at once. It will just count that entire tree as one unit during its count toward MaxConcurrentReqs. Regards, Christian - Christian Gilmore Technology Leader GeT WW Global Applications Development IBM Software Group
RE: Throttling, once again
Hi, Drew. I came across the very problem you're having. I use mod_bandwidth, its actively maintained, allows via IP, directory or any number of ways to monitor bandwidth usage http://www.cohprog.com/mod_bandwidth.html The size of the data sent through the pipe doesn't reflect the CPU spent to produce that data. mod_bandwidth probably doesn't apply in the current scenario being discussed. Thanks, Christian - Christian Gilmore Technology Leader GeT WW Global Applications Development IBM Software Group
Re: XML::RPC
I think you'll find RPC::XML to be a solidly engineered module. I've used it as a client and as a server to good effect. It includes stand-alone, CGI, and mod_perl based servers and a very nice client. I will second the vote for RPC::XML. We use this module with great success under mod_perl. It's very easy to understand for the most part. There are a few little oddities, but I'm sure myself or Paul can get you around any obstacles you hit. -Fran
Re: Problem using Perl Modules under mod_perl / PerlSetVar not working
At 12:52 22.04.2002, Sören Stuckenbrock wrote: Nope, using: Alias /contest /www/u-dev/contest PerlModule Apache::Registry PerlModule Apache::DBI PerlTaintCheck On Location /contest SetHandler perl-script PerlHandler Apache::Registry PerlSetVar BlaTest BlaVal PerlRequire /www/u-dev/contest/mod_perl_init.pl Options ExecCGI PerlSendHeader Off allow from all /Location doesn't work any better... As the folks said you need to use $r-dir_config if you want to pull the Location specific value. Does this mean I have to add this to my scripts directly and can't do it at Server-Startup in my startup.pl? Here's what Geoffrey Young said, you seem to have missed it: you can't use $s (the server record) to capture PerlSetVar that exist on a per-directory basis (within a Location or Directory block). try Apache-request-dir_config('BlaTest'); instead. you should use $s-dir_config() for items set on a per-server basis only, not per-directory. As far as I understand him, you can use Apache-request inside the startup.pl script (try it!) -- Per Einar Ellefsen [EMAIL PROTECTED]
Re: XML::RPC
Ciao! As has been pointed out in the past, the VERSION of a module does not necessarily reveal the module's maturity or robustness. This is particularly true for the RPC::XML module. I am using it in two production environments, in both client and modperl-enabled server modes with excellent results. It's dependency on the XML::Parser module has been a NO-OP for my Solaris8 deployment platforms. I am pleased with its overall performance, ease of use and robustness, as well as the author's continued support. YMMV. Peace. Eric == Eric Frazier [EMAIL PROTECTED] writes: Eric Hi, Thanks, the thing that scared me about RPC::XML was the Eric 0.37 version number :) Eric I will give it a serious try before I go to something like Eric SOAP. Eric Within RPC::XML: Eric Apache::RPC::Server - A subclass of RPC::XML::Server tuned Ericfor mod_perl Eric I didn't see this until now. :) Getting warm fuzzy feeling Eric now. Thanks again,
Re: mod_perl installation on Win32
xk wrote: I assume this is for mod_perl-1? Apache version info (shown on error web pages): Apache/2.0.35 (Win32) mod_perl/1.99_02-dev Perl/v5.6.1 Is this mod_perl 1.0 or 2.0? When I installed (from the location you pointed - theoryx5) it said mod_perl 2.0, but on Apache is shows 1.99 remember to use the script to report bugs, otherwise there will be no end to confusion. See: http://perl.apache.org/preview/modperl-docs/dst_html/docs/2.0/user/help/help.html#Reporting_Problems Do you have a LoadModule perl_module modules/mod_perl.so line in your httpd.conf file? Yes, I do. Perl scripts work now fine if I put the correct path in them. But I'd like to setup Apache::Registry to get rid of this limitation. if you want to use Apache::Registry from 1.x, you need to add: use Apache::compat; to your startup.pl. In 2.0 this is now ModPerl::Registry (though it's not 100% completed yet) I've managed to get some error texts: == [error] Can't locate loadable object for module Apache::Constants in @INC at .../Perl/site/lib/mod_perl.pm line 14 14:if ($ENV{MOD_PERL}) { 15:(defined {$class.'::bootstrap'} ? 16: \{$class.'::bootstrap'} : 17: \DynaLoader::bootstrap)- 18: ($class, $version); 19:} Compilation failed in require at .../Perl/site/lib/Apache.pm line 6. BEGIN failed--compilation aborted at .../Perl/site/lib/Apache.pm line 6. 6: use Apache::Constants qw(OK DECLINED); Compilation failed in require at .../Perl/site/lib/Apache/Registry.pm line 2. BEGIN failed--compilation aborted at .../Perl/site/lib/Apache/Registry.pm line 2. 2: use Apache (); Compilation failed in require at (eval 1) line 3. [error] Can't load Perl module Apache::Registry ... the ... and the code snippets are from me. Are there any modules missing? Althrough I'm a good C++ programmer, I don't know anything about how perl manages the modules, so I can't tell what's really wrong and I don't know where to look. -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: Problem using Perl Modules under mod_perl / PerlSetVar not working
Here's what Geoffrey Young said, you seem to have missed it: you can't use $s (the server record) to capture PerlSetVar that exist on a per-directory basis (within a Location or Directory block). try Apache-request-dir_config('BlaTest'); instead. you should use $s-dir_config() for items set on a per-server basis only, not per-directory. As far as I understand him, you can use Apache-request inside the startup.pl script (try it!) no, you can't use Apache-request from a startup.pl script - I must have missed the startup.pl requirement in the original post. but the rest is true, though, and Stas provided more details in a later post as well. additionally, recipe 17.1 in the cookbook talks about this exact issue. HTH --Geoff
Re: mod_perl installation on Win32
On Mon, 22 Apr 2002, xk wrote: Hi. I'm getting the following mod_perl error when I try to run a perl script through Apache: [error] failed to resolve handler `Apache::Registry' My configuration is: - Alias /perl/ C:/My Documents/HTML/xk Sound/perl/ #PerlModule Apache::Registry Location /perl SetHandler perl-script PerlHandler Apache::Registry Options +ExecCGI /Location - If I uncomment the #PerlModule Apache::Registry line, Apache will exit as soon as I start it, without any message in his window or the logs. I do have Apache::Registry installed, so what's wrong? I assume this is for mod_perl-1? Do you have a LoadModule perl_module modules/mod_perl.so line in your httpd.conf file? best regards, randy kobes
Re: mod_perl installation on Win32
I assume this is for mod_perl-1? Apache version info (shown on error web pages): Apache/2.0.35 (Win32) mod_perl/1.99_02-dev Perl/v5.6.1 Is this mod_perl 1.0 or 2.0? When I installed (from the location you pointed - theoryx5) it said mod_perl 2.0, but on Apache is shows 1.99 Do you have a LoadModule perl_module modules/mod_perl.so line in your httpd.conf file? Yes, I do. Perl scripts work now fine if I put the correct path in them. But I'd like to setup Apache::Registry to get rid of this limitation. I've managed to get some error texts: == [error] Can't locate loadable object for module Apache::Constants in INC at .../Perl/site/lib/mod_perl.pm line 14 14:if ($ENV{MOD_PERL}) { 15:(defined {$class.'::bootstrap'} ? 16: \{$class.'::bootstrap'} : 17: \DynaLoader::bootstrap)- 18: ($class, $version); 19:} Compilation failed in require at .../Perl/site/lib/Apache.pm line 6. BEGIN failed--compilation aborted at .../Perl/site/lib/Apache.pm line 6. 6: use Apache::Constants qw(OK DECLINED); Compilation failed in require at .../Perl/site/lib/Apache/Registry.pm line 2. BEGIN failed--compilation aborted at .../Perl/site/lib/Apache/Registry.pm line 2. 2: use Apache (); Compilation failed in require at (eval 1) line 3. [error] Can't load Perl module Apache::Registry ... the ... and the code snippets are from me. Are there any modules missing? Althrough I'm a good C++ programmer, I don't know anything about how perl manages the modules, so I can't tell what's really wrong and I don't know where to look.
RE: mod_perl installation on Win32
At 20:35 22.04.2002, David LeBlanc wrote: If Apache::Registry depends on Apache to access the registry, I don't believe that Apache uses the registry anymore, at least for file associations. The old change this setting to make apache look in the registry for file associations stuff is gone from the Apache 2.0 conf file. The Apache module doesn't use the resgistry at all, does it? David, I think you should read up on what Apache::Registry does :) It compiles CGI scripts to run them under mod_perl, it has nothing to do with the Windows Registry :) -- Per Einar Ellefsen [EMAIL PROTECTED]
Re: mod_perl installation on Win32
At 20:15 22.04.2002, xk wrote: I assume this is for mod_perl-1? Apache version info (shown on error web pages): Apache/2.0.35 (Win32) mod_perl/1.99_02-dev Perl/v5.6.1 Is this mod_perl 1.0 or 2.0? When I installed (from the location you pointed - theoryx5) it said mod_perl 2.0, but on Apache is shows 1.99 Do you have a LoadModule perl_module modules/mod_perl.so line in your httpd.conf file? Yes, I do. Perl scripts work now fine if I put the correct path in them. But I'd like to setup Apache::Registry to get rid of this limitation. I've managed to get some error texts: == [error] Can't locate loadable object for module Apache::Constants in @INC at .../Perl/site/lib/mod_perl.pm line 14 14:if ($ENV{MOD_PERL}) { 15:(defined {$class.'::bootstrap'} ? 16: \{$class.'::bootstrap'} : 17: \DynaLoader::bootstrap)- 18: ($class, $version); 19:} Compilation failed in require at .../Perl/site/lib/Apache.pm line 6. BEGIN failed--compilation aborted at .../Perl/site/lib/Apache.pm line 6. 6: use Apache::Constants qw(OK DECLINED); Compilation failed in require at .../Perl/site/lib/Apache/Registry.pm line 2. BEGIN failed--compilation aborted at .../Perl/site/lib/Apache/Registry.pm line 2. 2: use Apache (); Compilation failed in require at (eval 1) line 3. [error] Can't load Perl module Apache::Registry ... the ... and the code snippets are from me. Are there any modules missing? Althrough I'm a good C++ programmer, I don't know anything about how perl manages the modules, so I can't tell what's really wrong and I don't know where to look. Did you have an old version of mod_perl installed? The modules you are using seem to be from mod_perl 1, while you need the mod_perl 2 ones. If in doubt, try inserting PerlModule Apache2 before any other Perl* directives. -- Per Einar Ellefsen [EMAIL PROTECTED]
Re: framesets/AuthCookie question
Followup from last week: I'm using AuthCookie and as some of you know, if it determines your session to be invalid it redirects to a login page instead by way of a FORBIDDEN response coupled with a custom_response error page. [snip] ...I then thought it'd be neat to include on the login page handler output a message to tell them how they got there (Your session has expired, Your account has logged on from another location, Invalid username/password combination, whatever...). At first I thought I could accomplish this by simply doing $r-notes('LOGINFAILMSG' = 'Your session has expired') if AuthCookie detected it to be thus, and then in my handler I could retrieve it and display it. New observations It seems that even if AuthCookie returns a FORBIDDEN with a custom_error page set, the $r-notes() don't propagate. Does apache consider the display of the custom_response page to be a completely new request? -Fran
Re: mod_perl installation on Win32
Did you have an old version of mod_perl installed? The modules you are using seem to be from mod_perl 1, while you need the mod_perl 2 ones. I seem to have installed an older version before 2.0, but I'm not sure. In my /site/lib dir I have both Apache and Apache2 subdir. Is this ok? And I've found two mod_perl.pl files: one in /site/lib with version 1.2601 and one in /site/lib/Apache2 with version 1.9902. How can I uninstall the first one? If in doubt, try inserting PerlModule Apache2 before any other Perl* directives. I did this and now it says [error] Can't locate object method boot via package mod_perl::boot How can I check if module mod_perl::boot for example is installed? The docs aren't clear on this.
startup for Apache 2.0/mod_perl 1.99
To all, Having trouble configuring Apache 2.0 with mod_perl. Don't know if I need compat or not. My Apache 1.x/mod_perl 1.24 startup starts like this: use strict;use Apache ();use Apache::Registry;use Apache::DBI();use CGI qw(-compile :cgi);use Carp(); That didn't fly on Apache 2.0.35/mod_perl 1.99 (snapshot). Trying to get something equivalent working. Below doesn't work with or without Apache::compat. use strict;use Apache2 ();use Apache::compat;use ModPerl::Registry; # use Apache::Registry; #use Apache2::DBI(); # use Apache::DBI();use DBI();use CGI qw(-compile :cgi); Apacheerrorlog id like so (last line): ... [Mon Apr 22 18:00:23 2002] [notice] Parent: Child process exited successfully.[Mon Apr 22 18:00:38 2002] [notice] Parent: Created child process 2560[Mon Apr 22 18:00:46 2002] [notice] Child 2560: Child process is running[Mon Apr 22 18:00:46 2002] [notice] Child 2560: Acquired the start mutex.[Mon Apr 22 18:00:46 2002] [notice] Child 2560: Starting 250 worker threads.[Mon Apr 22 18:00:58 2002] [error] failed to resolve handler `Apache::Registry' From perl -V: @INC: c:/perl/5.6.1/lib/MSWin32-x86-multi-thread c:/perl/5.6.1/lib c:/perl/site/5.6.1/lib/MSWin32-x86-multi-thread c:/perl/site/5.6.1/lib . Test program: #! c:/perl/5.6.1/bin/MSWin32-x86-multi-thread/perl.exe -wuse CGI qw/:standard :html3/;use CGI::Carp qw(fatalsToBrowser); use DBI(); # use Apache::DBI();$cgiOBJ = new CGI; $dataSource = "dbi:Oracle:rciora"; # put your DSN here$userName = 'terminals'; $password = 'xxx'; $dbh = DBI-connect($dataSource, $userName, $password) or die $DBI::errstr; print $cgiOBJ-header(-expires='-1d'), $cgiOBJ-start_html(-TITLE='oracle test.pl', -BGCOLOR='#FF'); print "start herehr";$sql = "SELECT * FROM terminals.assets where substr(asset_part_no,1,1) = 'B'";$sth = $dbh-prepare($sql) || die $dbh-errstr;$rc = $sth-execute || die $sth-errstr;while (($firstField, $anotherField) = $sth-fetchrow_array){ print "$firstField: $anotherFieldbr\n";}warn $DBI::errstr if $DBI::err;$sth-finish; # disconnect from database$dbh-disconnect; print "hrend here"; print $cgiOBJ-end_html;
Re: mod_perl installation on Win32
Just posted minutes ago on this. This partially fixed me also. Problem was the line in the /perl container (PerlHandler Apache::Registry instead of PerlHandler ModPerl::Registry). Except now I get this: [Mon Apr 22 18:32:37 2002] [error] 1580: ModPerl::Registry: `Can't call method args on an undefined value at c:/perl/5.6.1/lib/CGI.pm line 433. It is referring to the IF statement: if ($MOD_PERL) { $query_string = Apache-request-args; } else { $query_string = $ENV{'QUERY_STRING'} if defined $ENV{'QUERY_STRING'}; $query_string ||= $ENV{'REDIRECT_QUERY_STRING'} if defined $ENV{'REDIRECT_QUERY_STRING'}; } In CGIpm up at line 148 there is this: # Turn on special checking for Doug MacEachern's modperl if (exists $ENV{'GATEWAY_INTERFACE'} ($MOD_PERL = $ENV{'GATEWAY_INTERFACE'} =~ /^CGI-Perl\//)) { $| = 1; require Apache; } Do I need to define 'GATEWAY_INTERFACE', or is it provided automatically by mod_perl? This is on Win2000. Thanks Chuck - Original Message - From: Randy Kobes [EMAIL PROTECTED] To: xk [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, April 22, 2002 3:16 PM Subject: Re: mod_perl installation on Win32 On Mon, 22 Apr 2002, xk wrote: Apache version info (shown on error web pages): Apache/2.0.35 (Win32) mod_perl/1.99_02-dev Perl/v5.6.1 Is this mod_perl 1.0 or 2.0? When I installed (from the location you pointed - theoryx5) it said mod_perl 2.0, but on Apache is shows 1.99 This is normal - mod_perl, version 2.0, hasn't yet been released; the version on CPAN, which the above is reporting, is 1.99_01. I've managed to get some error texts: == [error] Can't locate loadable object for module Apache::Constants in @INC at .../Perl/site/lib/mod_perl.pm line 14 14:if ($ENV{MOD_PERL}) { 15:(defined {$class.'::bootstrap'} ? 16: \{$class.'::bootstrap'} : 17: \DynaLoader::bootstrap)- 18: ($class, $version); 19:} Compilation failed in require at .../Perl/site/lib/Apache.pm line 6. BEGIN failed--compilation aborted at .../Perl/site/lib/Apache.pm line 6. I've seen this as well at times - do you have a mod_perl-1.xx distribution in the same Perl tree? If so, try temporarily renaming /Perl/site/lib/Apache.pm - /Perl/site/lib/Apache-1.pm /Perl/site/lib/Apache/ - /Perl/site/lib/Apache-1/ as sometimes I think it gets confused between mod_perl-2 and mod_perl-1 stuff. For using Registry things, there was a bug that Doug fixed a little while ago - you should reinstall mod_perl-2.ppd from http://theoryx5.uwinnipeg.ca/ppmpackages/. The version number hasn't changed with this fix, so if you're using the ppm utility to install things, you should first uninstall mod_perl-2 and then reinstall it. Here's an example set-up for Registry scripts. In httpd.conf: PerlRequire C:/Apache2/conf/extra.conf Alias /perl/ C:/Apache2/perl/ Location /perl SetHandler perl-script PerlHandler ModPerl::Registry Options +ExecCGI /Location where C:/Apache2/conf/extra.conf is === use Apache2; use ModPerl::Registry (); 1; === An example script to go into C:/Apache2/perl/ would be == #!c:/Perl/bin/Perl.exe ## ## printenv -- demo CGI program which just prints its environment ## print HTMLBODYUL; foreach $var (sort(keys(%ENV))) { $val = $ENV{$var}; $val =~ s|\n|\\n|g; $val =~ s||\\|g; print LI${var}=\${val}\/LI\n; } # sleep(10); print /UL/BODY/HTML; == which would then be accessed as http://localhost/perl/printenv. A nice example of how Apache-2/mod_perl-2 addresses the single-thread limitation of Apache-1/mod_perl-1, as discussed at http://perl.apache.org/win32_multithread.html, is to uncomment the sleep(10) line in the above script, then, from a DOS prompt, run quick multiple instances of GET http://localhost/perl/printenv and check the access times in the logs when the script was handled, and compare to mod_perl-1. best regards, randy
Re: startup for Apache 2.0/mod_perl 1.99
Chuck Goehring wrote: To all, Having trouble configuring Apache 2.0 with mod_perl. Don't know if I need compat or not. My Apache 1.x/mod_perl 1.24 startup starts like this: use strict; use Apache (); use Apache::Registry; use Apache::DBI(); use CGI qw(-compile :cgi); use Carp(); That didn't fly on Apache 2.0.35/mod_perl 1.99 (snapshot). Trying to get something equivalent working. If you want to use the old registry, the above missing: use Apache2 (); use Apache::compat; Below doesn't work with or without Apache::compat. use strict; use Apache2 (); use Apache::compat; use ModPerl::Registry;# use Apache::Registry; #use Apache2::DBI(); # use Apache::DBI(); use DBI(); use CGI qw(-compile :cgi); looks good to me. You don't show your Location config. Does it include SetHandler perl-script PerlResponseHandler ModPerl::Registry ?? Apache error log id like so (last line): [Mon Apr 22 18:00:58 2002] [error] failed to resolve handler `Apache::Registry' Apache::Registry? Above you said you are using ModPerl::Registry. Check your config. I suggest to grep for Apache::Registry. Apache::DBI (for 2.0 wasn't ported yet, and available for those seeking interesting challenges) __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
cvs commit: modperl STATUS
geoff 02/04/22 12:50:40 Modified:.STATUS Log: add notes('error-notes') enhancement report and patch to STATUS Revision ChangesPath 1.16 +10 -1 modperl/STATUS Index: STATUS === RCS file: /home/cvs/modperl/STATUS,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- STATUS14 Apr 2002 17:25:03 - 1.15 +++ STATUS22 Apr 2002 19:50:40 - 1.16 -1,5 +1,5 mod_perl 1.3 STATUS: - Last modified at [$Date: 2002/04/14 17:25:03 $] + Last modified at [$Date: 2002/04/22 19:50:40 $] Release: -16,6 +16,15 patch available at http://marc.theaimsgroup.com/?l=apache-modperlm=101729204503165w=2 +* implement notes('error-notes') in Registry a la mod_cgo +Report: http://marc.theaimsgroup.com/?l=apache-modperlm=101862462900504w=2 + Status: + I haven't had the chance to investigate this thoroughly, but + mod_perl does seem to be setting error-notes for some things. maybe + just not enough things or Registry specific things? --Geoff + patch available at + http://marc.theaimsgroup.com/?l=apache-modperlm=101862462900504w=2 + Needs Patch or Further Investigation