Re: startup for Apache 2.0/mod_perl 1.99

2002-04-24 Thread Chuck Goehring

Stas,

That made it work!  Your my hero!.  That also made the script that accesses
Oracle work as well.  We've staved off the IIS beast for another day!

I'm not familiar with the testing stuff except when Doug had me run the
t/report thing..  I'm a CGI guy rather that an apache handler/C language
type.

The 250 was the built-in default value.  I  hadn't set anything related to
threads because I haven't read any of that yet.  Just trying to get things
basically working.  The high memory consumption and sluggish response may
have been aggravated by the missing directive and this machine only has
128MB memory.  It's running on my workstation that has many applications
open all the time.

Thanks for the help.

Chuck

- Original Message -
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Chuck Goehring" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, April 23, 2002 8:53 PM
Subject: Re: startup for Apache 2.0/mod_perl 1.99


> Chuck Goehring wrote:
> > You're right.  I'm getting impatient and jumping ahead.  Pasted directly
> > from your post, restarted Apache and get same thing
> >
> > [Tue Apr 23 12:16:54 2002] [notice] Parent: Created child process 2560
> > [Tue Apr 23 12:16:58 2002] [notice] Child 2560: Child process is running
> > [Tue Apr 23 12:16:58 2002] [notice] Child 2560: Acquired the start
mutex.
> > [Tue Apr 23 12:16:58 2002] [notice] Child 2560: Starting 250 worker
threads.
> > [Tue Apr 23 12:17:46 2002] [error] 2560: 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'};
> >}
> I know what was missing.
>
> add 'PerlOptions +GlobalRequest', like so:
>
> 
>SetHandler perl-script
>PerlResponseHandler ModPerl::Registry
>Options ExecCGI
>PerlSendHeader On
>PerlOptions +GlobalRequest
> 
>
>
http://perl.apache.org/preview/modperl-docs/dst_html/docs/2.0/user/config/co
nfig.html#PerlOptions_Directive
> # GlobalRequest
> Setup the global request_rec for use with Apache->request
>
> Sorry for missing this one, I'm not used to it yet :)
>
> Also I'd like to repeat that the 2.0 test suite is the best place to
> learn how, before the docs will be completed.
>
> __
> 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: startup for Apache 2.0/mod_perl 1.99

2002-04-23 Thread Chuck Goehring

Stas/Everyone,

To follow up.  With the starting and stopping of Apache and looking at the
log, I see entries like "Child 1032: Waiting for 250 worker threads to
exit."  I was gettiong "Low virtual memory" errors from Win/2000, so I added
ThreadsPerChild 24 to the http.conf.  This makes it stop quicker and use a
whole lot less memory.  Also, the error at the browser comes back faster.

I added use "Apache::compat;" to the test program after "use
ModPerl::Registry;" hoping it would stop it from complaining about CGI.pm.
But, I still get Error 500 in the browser and "[error] 2724:
ModPerl::Registry: `Can't call method "args" on an undefined value at
c:/perl/5.6.1/lib/CGI.pm line 433." in the log.

The build I'm using is modperl-2.0_2002042700.tar.gz.

I tried adding PerlModule Apache2 to http.conf  right after "LoadModule
perl_module modules/mod_perl.so" and I get a "Application Error/memory could
not be read".  The same CGI.pm error appears in the log.

Also, the CGI.pm I have is dated 03/03/2001 and came with perl 5.6.1.

Thanks
Chuck



- Original Message -
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Chuck Goehring" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, April 23, 2002 11:12 AM
Subject: Re: startup for Apache 2.0/mod_perl 1.99


> Chuck Goehring wrote:
> > Stas,
> > First, there was no mod_perl 1.2x installed on this machine.  I didn't
think
> > I would need it, but I'm guessing.
> >
> > This was as you say.  The  didn't aggree with the
registry
> > loaded in startup.  That fixed that problem but now it complains about
> > CGI.pm as follows:
> >
> > [Tue Apr 23 10:10:00 2002] [error] 2676: ModPerl::Registry: `Can't call
> > method "args" on an undefined value at c:/perl/5.6.1/lib/CGI.pm line
433.
>
> It's a very bad idea to try to find the problem without reducing the
> setup to a bare minimum.
>
> Does the very basic setup work for you? If it does, start from here and
> add things till you hit the problem.
>
> httpd.conf:
> ---
> LoadModule perl_module modules/mod_perl.so
> Alias /perl e:/Apache2/cgi-perl
> PerlRequire e:\apache2\conf\startup.cgi
>
> 
>SetHandler perl-script
>PerlResponseHandler ModPerl::Registry
>Options ExecCGI
>PerlSendHeader On
> 
>
> startup.pl:
> ---
> #! /perl/5.6.1/bin/MSWin32-x86-multi-thread/perl.exe -w
>
> use strict;
> use Apache2 ();
> use Apache::compat;
>
> and a test script:
> #! c:/perl/5.6.1/bin/MSWin32-x86-multi-thread/perl.exe -w
> use ModPerl::Registry;
> use CGI;
>
> $q = new CGI;
>
> print $q->header,
>$q->start_html(),
>'Hello',
>$q->end_html();
>
>
> __
> 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: startup for Apache 2.0/mod_perl 1.99

2002-04-23 Thread Chuck Goehring


You're right.  I'm getting impatient and jumping ahead.  Pasted directly
from your post, restarted Apache and get same thing

[Tue Apr 23 12:16:54 2002] [notice] Parent: Created child process 2560
[Tue Apr 23 12:16:58 2002] [notice] Child 2560: Child process is running
[Tue Apr 23 12:16:58 2002] [notice] Child 2560: Acquired the start mutex.
[Tue Apr 23 12:16:58 2002] [notice] Child 2560: Starting 250 worker threads.
[Tue Apr 23 12:17:46 2002] [error] 2560: 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 CGI>pm 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: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Chuck Goehring" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, April 23, 2002 11:12 AM
Subject: Re: startup for Apache 2.0/mod_perl 1.99


> Chuck Goehring wrote:
> > Stas,
> > First, there was no mod_perl 1.2x installed on this machine.  I didn't
think
> > I would need it, but I'm guessing.
> >
> > This was as you say.  The  didn't aggree with the
registry
> > loaded in startup.  That fixed that problem but now it complains about
> > CGI.pm as follows:
> >
> > [Tue Apr 23 10:10:00 2002] [error] 2676: ModPerl::Registry: `Can't call
> > method "args" on an undefined value at c:/perl/5.6.1/lib/CGI.pm line
433.
>
> It's a very bad idea to try to find the problem without reducing the
> setup to a bare minimum.
>
> Does the very basic setup work for you? If it does, start from here and
> add things till you hit the problem.
>
> httpd.conf:
> ---
> LoadModule perl_module modules/mod_perl.so
> Alias /perl e:/Apache2/cgi-perl
> PerlRequire e:\apache2\conf\startup.cgi
>
> 
>SetHandler perl-script
>PerlResponseHandler ModPerl::Registry
>Options ExecCGI
>PerlSendHeader On
> 
>
> startup.pl:
> ---
> #! /perl/5.6.1/bin/MSWin32-x86-multi-thread/perl.exe -w
>
> use strict;
> use Apache2 ();
> use Apache::compat;
>
> and a test script:
> #! c:/perl/5.6.1/bin/MSWin32-x86-multi-thread/perl.exe -w
> use ModPerl::Registry;
> use CGI;
>
> $q = new CGI;
>
> print $q->header,
>$q->start_html(),
>'Hello',
>$q->end_html();
>
>
> __
> 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: startup for Apache 2.0/mod_perl 1.99

2002-04-23 Thread Chuck Goehring

Stas,
First, there was no mod_perl 1.2x installed on this machine.  I didn't think
I would need it, but I'm guessing.

This was as you say.  The  didn't aggree with the registry
loaded in startup.  That fixed that problem but now it complains about
CGI.pm as follows:

[Tue Apr 23 10:10:00 2002] [error] 2676: ModPerl::Registry: `Can't call
method "args" on an undefined value at c:/perl/5.6.1/lib/CGI.pm line 433.

As you suggested, the use Apache::compat; is in startup.  It had no effect.

Here is location in http.conf
LoadModule perl_module modules/mod_perl.so
Alias /perl e:/Apache2/cgi-perl
PerlRequire e:\apache2\conf\startup.cgi

# Access.conf

  # Below for .js files
  AllowOverride FileInfo
  # Below changed from Set to Add to accomodate .js files
  # Vaguely recall some problem on newsgroups but?
  # don't use this one SetHandler perl-script
  AddHandler perl-script .cgi
  #PerlHandler Apache::Registry
  PerlHandler ModPerl::Registry
  PerlResponseHandler ModPerl::Registry
  Options ExecCGI
  allow from 206.128.139
  PerlSendHeader On


==> Here is startup.cgi
#! /perl/5.6.1/bin/MSWin32-x86-multi-thread/perl.exe -w

use strict;
#use Apache ();
use Apache2 ();
use Apache::compat;
use ModPerl::Registry;
use DBI();
use CGI qw(-compile :cgi);
use Carp();

use DBI();
use CGI qw(-compile :cgi);

1;
__END__

===> Here's the test program:
#! c:/perl/5.6.1/bin/MSWin32-x86-multi-thread/perl.exe -w
use Apache2 ();
use Apache::compat;
use ModPerl::Registry;#  use Apache::Registry;

use CGI qw/:standard :html3/;
use CGI::Carp qw(fatalsToBrowser);
use DBI(); # use Apache::DBI();
$cgiOBJ = new CGI;

$dataSource = "dbi:Oracle:dis.world"; # put your DSN here
$dataSource = "dbi:Oracle:rciora"; # put your DSN here
$userName   = 'terminals'; # you know what goes here
$password   = ''; # and here
$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 here";
$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: $anotherField\n";
}
warn $DBI::errstr if $DBI::err;
$sth->finish;

$dbh->disconnect;

print "end here";

print $cgiOBJ->end_html;

Thanks for any input.

Chuck




- Original Message -
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Chuck Goehring" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 7:26 PM
Subject: 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  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




Re: mod_perl installation on Win32

2002-04-22 Thread Chuck Goehring


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 CGI>pm 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/"
> 
>SetHandler perl-script
>PerlHandler ModPerl::Registry
>Options +ExecCGI
> 
> 
> 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 "";
> foreach $var (sort(keys(%ENV))) {
>   $val = $ENV{$var};
>   $val =~ s|\n|\\n|g;
>   $val =~ s|"|\\"|g;
>   print "${var}=\"${val}\"\n";
> }
> # sleep(10);
> print "";
> ==
> 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




startup for Apache 2.0/mod_perl 1.99

2002-04-22 Thread Chuck Goehring



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);
 
 
Apache error log 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 here";$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: $anotherField\n";}warn $DBI::errstr if 
$DBI::err;$sth->finish;
 
# disconnect from 
database$dbh->disconnect;
 
print "end here";
 
print $cgiOBJ->end_html;
 
 
 


Re: apache 2.0.35 + windows + mod_perl + activestate perl

2002-04-22 Thread Chuck Goehring

Paolo,

Sorry, wrong URL.  That URL is for 1.x Apache use.  For 2.0 use 1.99 stuff
from  http://cvs.apache.org/snapshots/modperl-2.0/.  It has snapshots
(bleeding edge).  This version compiled for me.  Still trying to get it
configured, though.


Below was the original version Doug released.  Others were able to use it,
but I had some problems getting it compiled.
http://perl.apache.org/dist/mod_perl-1.99_01.tar.gz


Chuck


- Original Message -
From: "Paolo" <[EMAIL PROTECTED]>
To: "Chuck Goehring" <[EMAIL PROTECTED]>
Sent: Sunday, April 14, 2002 6:57 AM
Subject: Re: apache 2.0.35 + windows + mod_perl + activestate perl


> Chuck Goehring wrote:
>
> > Paolo,
> >
> > Download 1.99 from http://perl.apache.org/.  I havn't quite got it
working
> > but the correct version is there.
> >
> > Chuck
>
> I downloaded the latest following instruction on perl.apache.org... so
using
> activestate ppm.
> But it isn't working despite my hard work =(
> Send me news about it if you can please =)
> Paolo
>
>
>




Re: Apache/Mod_Perl in Production Env-- NOT Recommended in Windows?

2002-04-19 Thread Chuck Goehring

Per,

We run Apache 1.x with mod_perl on Windows 2000.  It has been in production
for 2.5-3 years.  It is rather lightly loaded.  It runs a query system that
accesses an Oracle database.  It may have crashed twice in all that time.
Previously, we used IIS and it would go off to lala land at least monthly.
So, this is good.

As Rex wrote, it serializes requests which is pretty awful for this day.  I
think this is a PERL issue rather than a mod_perl or Apache issue, however.
I was quite disappointed that these things haven't gotten further by now.  I
would consider helping out, but C is not my area of expertise.  With 1.x, I
had problems trying to get SSL built and the binaries I downloaded seamed to
hang.  I'm trying to get moved to Apache 2.0 to get stable SSL.  Since the
Apache 1.x we have been using for all this time was considered Beta on
Windows, I don't have much to lose.  If I don't get this resolved, they will
probably make me switch back to IIS.

Bottom line is, I like the programming environment, but the support and
documentation from the ssl/mod_ssl/openssl and PERL (perl.exe) has been
somewhat inadequate.  The mod_perl list has kept me going and Doug makes it
all possible.

Chuck


- Original Message -
From: "Per Einar Ellefsen" <[EMAIL PROTECTED]>
To: "Arul, Rex" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, April 18, 2002 1:24 AM
Subject: Re: Apache/Mod_Perl in Production Env-- NOT Recommended in Windows?


> At 03:48 18.04.2002, Arul, Rex wrote:
> >Friends,
> >
> >I know Apache/Mod_Perl on OS other than Windows to be the trend du juor.
> >However, I am in jitters seeing this explicit warning given in
> >http://www.perl.com web-portal.
> >
> >"NOTE: it is not recommended to use Windows for production
Apache/mod_perl
> >servers; Apache/mod_perl 1.x is not able to scale well on this platform;
> >Apache/mod_perl 2.x is addressing the fundamental architectural
> >disagreements that cause this."
> >
> >The article is
here:http://www.perl.com/pub/a/2002/03/12/axkit.html?page=2
> >
> >Has anyone in this list use Apache/Mod_Perl in **WINDOWS OS** under
> >**Production Environment **?
>
> Well, the issue on Windows is that the mod_perl server can only serve one
> request at a time. So clearly, it's a problem. However, some people have
> reported that it would still give them a great performance increase, by
> following some special steps.
>
> Get a proxy setup like described at various places in the guide
> http://perl.apache.org/guide/ : the proxy serves most of the requests, and
> sends some requests off to the backend mod_perl enabled server. Good
> caching should be a plus: the less requests sent to the mod_perl-enabled
> server the better.
>
> This isn't all too different from standard mod_perl setups, but you have
to
> watch out even more when running on Windows. You might even want to try
and
> setup several backend mod_perl servers and load balance between them, all
> depending on how much memory you can spare.
>
>
> --
> Per Einar Ellefsen
> [EMAIL PROTECTED]
>
>




Re: mod_perl 1.99 (for Apache 2.0.35) building on W2K

2002-04-15 Thread Chuck Goehring



Pascal,
 
Thanks, I needed some good news.
 
Chuck

  - Original Message - 
  From: 
  pascal barbedor 
  To: Chuck Goehring 
  Cc: [EMAIL PROTECTED] 
  Sent: Friday, April 12, 2002 11:41 
  PM
  Subject: Re: mod_perl 1.99 (for Apache 
  2.0.35) building on W2K
  
  Hi chuck
   
  for DBI and DBD::xx it makes no difference if you 
  use them with regular cgi modperl 1 or 2 because they are unrelated to web 
  environment. (at least i suppose so a priori).
   
  at least in my test they are used without problem 
  in startup.pl.
   
  for cgi.pm used outside modpelr with 2.0.35 no 
  difference as well
  and for cgi.pm used with modperl I don't 
  know.
   i guess there is a difference, at 
  least in the Apache::registry setup of the location to use the cgi like 
  script 
   
  pascal
   
   
   
   
   
  
- Original Message - 
From: 
Chuck 
Goehring 
To: pascal barbedor 
Sent: Saturday, April 13, 2002 5:11 
AM
Subject: Re: mod_perl 1.99 (for Apache 
2.0.35) building on W2K

Pascal and anyone else who can 
help,
 
I've seen your other posts and I'm wondering 
how your testing is going with "regular" cgi programs.  I don't use any 
of the exotic mod_perl specifics, so I'm no help there.  I'll have to 
"aquire" more facilities to setup like you have (nt boxes in short 
supply). 
 
I'm mostly concerned about the cgi.pm, dbi.pm 
dbd::oracle etc.  
 
Anybody know the impact that Apache 2.0 has on 
these modules?
 
Chuck
 

  - Original Message ----- 
  From: 
  pascal barbedor 
  To: Chuck Goehring 
  Sent: Thursday, April 11, 2002 4:40 
  AM
  Subject: Re: mod_perl 1.99 (for 
  Apache 2.0.35) building on W2K
  
  Hi I am trying to build modperl under 
  win2k
  saw your message.
  don't know about your problem but 
  :
   
  i use already built asperl build 
  631
  I have built apache succesfully, but 
  when trying to build modperl2
  i am asked apxs
   
  did you find the apxs program ?
  thanks
   
  pascal 
  barbedor


mod_perl 1.99 (for Apache 2.0.35) building on W2K

2002-04-10 Thread Chuck Goehring



To all,
 
I'm attempting to build newest versions of 
Apache/perl/mod_perl for WIN/2000.  All went well until building 
mod_perl.  There is lots of detail furtur down.  To summarize, at the end of the make (using nmake) there are 
21 of these apr_bucket errors and then it dies with fatal errors like 
below.
 
I suspect this might be some sort of #define issue 
related to windows.
 
Thanks for the input.
 
Chuck Goehring
 
= The short versionmodperl_filter.c(216) : 
error C2039: 'link' : is not a member of 
'apr_bucket'    
e:\apache2/include\apr_buckets.h(233) : see declaration of 'apr_bucket'NMAKE 
: fatal error U1077: 'cl' : return code '0x2'Stop.NMAKE : fatal error 
U1077: 'cd' : return code '0x2'Stop.
 
= From the MS online help for nmake.exe:NMAKE Fatal Error 
U1077'program' : return code 'value'
 
The given command or program called by NMAKE failed and returned the given 
exit code.
 
To suppress this error and continue the NMAKE session, use the /I option, 
the .IGNORE dot directive, or the dash (-) command modifier. To continue the 
NMAKE session for unrelated parts of the dependency tree, use the /K 
option.
 
= VERSIONSPerl 5.6.1Apache 2.0.35mod_perl 1.99_01
 
Visual C++ 6.0 SP 5nmake Version 6.00.8168.0Win 2000 sp2
 
Perl built fineApache built fine
 
mod_perl dies on the 13th file being compiled
 
perl Makefile.PL MP_AP_PREFIX=e:\apache2
 
... snip...
 
rmdir WrapXS/APR/Bucketunlink WrapXS/APR/Date/Date.pmunlink 
WrapXS/APR/Date/Date.xsunlink WrapXS/APR/Date/Makefileunlink 
WrapXS/APR/Date/Makefile.PLrmdir WrapXS/APR/Dateunlink 
WrapXS/APR/Lock/Lock.pmunlink WrapXS/APR/Lock/Lock.xsunlink 
WrapXS/APR/Lock/Makefileunlink WrapXS/APR/Lock/Makefile.PLrmdir 
WrapXS/APR/Lockunlink WrapXS/APR/Makefileunlink 
WrapXS/APR/Makefile.PLunlink WrapXS/APR/NetLib/Makefileunlink 
WrapXS/APR/NetLib/Makefile.PLunlink WrapXS/APR/NetLib/NetLib.pmunlink 
WrapXS/APR/NetLib/NetLib.xsrmdir WrapXS/APR/NetLibunlink 
WrapXS/APR/Pool/Makefileunlink WrapXS/APR/Pool/Makefile.PLunlink 
WrapXS/APR/Pool/Pool.pmunlink WrapXS/APR/Pool/Pool.xsrmdir 
WrapXS/APR/Poolunlink WrapXS/APR/Socket/Makefileunlink 
WrapXS/APR/Socket/Makefile.PLunlink WrapXS/APR/Socket/Socket.pmunlink 
WrapXS/APR/Socket/Socket.xsrmdir WrapXS/APR/Socketunlink 
WrapXS/APR/String/Makefileunlink WrapXS/APR/String/Makefile.PLunlink 
WrapXS/APR/String/String.pmunlink WrapXS/APR/String/String.xsrmdir 
WrapXS/APR/Stringunlink WrapXS/APR/Table/Makefileunlink 
WrapXS/APR/Table/Makefile.PLunlink WrapXS/APR/Table/Table.pmunlink 
WrapXS/APR/Table/Table.xsrmdir WrapXS/APR/Tableunlink 
WrapXS/APR/URI/Makefileunlink WrapXS/APR/URI/Makefile.PLunlink 
WrapXS/APR/URI/URI.pmunlink WrapXS/APR/URI/URI.xsrmdir 
WrapXS/APR/URIunlink WrapXS/APR/Util/Makefileunlink 
WrapXS/APR/Util/Makefile.PLunlink WrapXS/APR/Util/Util.pmunlink 
WrapXS/APR/Util/Util.xsrmdir WrapXS/APR/Utilunlink 
WrapXS/APR/UUID/Makefileunlink WrapXS/APR/UUID/Makefile.PLunlink 
WrapXS/APR/UUID/UUID.pmunlink WrapXS/APR/UUID/UUID.xsrmdir 
WrapXS/APR/UUIDrmdir WrapXS/APRunlink WrapXS/Makefileunlink 
WrapXS/Makefile.PLunlink WrapXS/ModPerl/Global/Global.pmunlink 
WrapXS/ModPerl/Global/Global.xsunlink 
WrapXS/ModPerl/Global/Makefileunlink 
WrapXS/ModPerl/Global/Makefile.PLrmdir WrapXS/ModPerl/Globalunlink 
WrapXS/ModPerl/Makefileunlink WrapXS/ModPerl/Makefile.PLunlink 
WrapXS/ModPerl/Util/Makefileunlink WrapXS/ModPerl/Util/Makefile.PLunlink 
WrapXS/ModPerl/Util/Util.pmunlink WrapXS/ModPerl/Util/Util.xsrmdir 
WrapXS/ModPerl/Utilrmdir WrapXS/ModPerlunlink WrapXS/typemaprmdir 
WrapXSmkdir WrapXSwriting...WrapXS\Makefile.PLmkdir 
WrapXS/Apachewriting...WrapXS\Apache\Makefile.PLmkdir 
WrapXS/APRwriting...WrapXS\APR\Makefile.PLmkdir 
WrapXS/ModPerlwriting...WrapXS\ModPerl\Makefile.PLwriting...WrapXS\typemapmkdir 
WrapXS\Apache\SubProcesswriting...WrapXS\Apache\SubProcess\Makefile.PLwriting...WrapXS\Apache\SubProcess\SubProcess.xswriting...WrapXS\Apache\SubProcess\SubProcess.pmmkdir 
WrapXS\APR\UUIDwriting...WrapXS\APR\UUID\Makefile.PLwriting...WrapXS\APR\UUID\UUID.xswriting...WrapXS\APR\UUID\UUID.pmmkdir 
WrapXS\APR\NetLibwriting...WrapXS\APR\NetLib\Makefile.PLwriting...WrapXS\APR\NetLib\NetLib.xswriting...WrapXS\APR\NetLib\NetLib.pmmkdir 
WrapXS\Apache\RequestRecwriting...WrapXS\Apache\RequestRec\Makefile.PLwriting...WrapXS\Apache\RequestRec\RequestRec.xswriting...WrapXS\Apache\RequestRec\RequestRec.pmmkdir 
WrapXS\ModPerl\Globalwriting...WrapXS\ModPerl\Global\Makefile.PLwriting...WrapXS\ModPerl\Global\Global.xswriting...WrapXS\ModPerl\Global\Global.pmmkdir 
WrapXS\Apache\Serverwriting...WrapXS\Apache\Server\Makefile.PLwriting...WrapXS\Apache\Server\Server.xswriting...WrapXS\Apache\Server\Server.pmmkdir 
WrapXS\Apache\CmdParmswriting...WrapXS\Apache\CmdParms\Makefile.PLwriting...WrapXS\Apache\CmdParms\CmdParms.xswriting...WrapXS\Apache\CmdParms\CmdParms.pmmkdir 
WrapXS\APR\Lockwriting...WrapXS\APR\Lock\Mak

Re: dear administrator, Unsubscribe me please

2002-04-09 Thread Chuck Goehring

Upal,

Outlook hides the stuff that is in the header of the emails.  Bill Gates
decided for you that you would never need to see this information.  I pasted
it below.   Doubleclick on the list-unsubscribe link below and send the
email off.  It is an automated system that only "reads" a few special words.

list-help: 
list-unsubscribe: 
list-post: 

Chuck

- Original Message -
From: "Upal" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 08, 2002 3:38 PM
Subject: dear administrator, Unsubscribe me please


>
> Dear Administrator of mod-perl discussion group,
>
> Please unsubscribe me from this group.
>
> With regards,
>
> Upal Nath
>
> =
> Upal.
>
> __
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://taxes.yahoo.com/
>




the coming of Apache 2.0

2002-04-05 Thread Chuck Goehring



 
 
The modssl-users list is all abuzz about the 
coming of Apache 2.0.  I don't hear a lot on this list on mod_perl support 
for Apache 2.0.  Is anyone planning to adopt this configuration in the near 
future?
 
Chuck


Re: webmail for mod_perl?

2002-02-28 Thread Chuck Goehring


I send only. Using MIME::Lite as below.  Working real well.  Requirements
included attachments and return receipts.

Havn't had to do the whole mail server thing.

Chuck

use MIME::Lite;
$lPB .= "\n\n";
foreach $recip (@recips) {
  $recip = CheckEAddress($recip);
  $msg = build MIME::Lite From => $aApobj->getEmail_Address,
  To  => $recip, Subject => $Sub,
  Type => 'TEXT', Data => $lPB;

  $OpStatus .= "Recipient: $recip.";
  if($aReceipt ne '') {  # If return reciept requested.
$msg->add("Disposition-Notification-To"=>
$aApobj->getEmail_Address);
  }
  #$TempFileName = $NewDocName;
  if(0==0) { # Production mode.
attach $msg
  Type => 'image/save_as_tiff',
  Encoding => 'base64',
  Path => $TempFileName,
  Filename => $NewDocName;
  }
...

- Original Message -
From: "will trillich" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 28, 2002 3:49 PM
Subject: webmail for mod_perl?


> is there a sane implementation of webmail-style mod_perl
> modules for apache?
>
> we're looking to offer email access online through
> apache/mod_perl similar to what folks get at yahoo/egroups --
> and we're hoping to find some mod_perl code that'll hook into
> pop/imap email servers. (and we're hoping to avoid loading php
> into ram.) i saw a thread in the archives (begun on Wed, 12 Dec
> 2001 by Medi Montaseri) but most of the suggestions seemed to
> point to php. we're hoping to stick with mod_perl. :)
>
> rtfm welcome if you specify which fm to r. :) thanks...
>
> --thanks!
>
> --
> Legalize Liberty.
>
> [EMAIL PROTECTED]
> http://sourceforge.net/projects/newbiedoc -- we need your brain!
> http://www.dontUthink.com/ -- your brain needs us!
>




Re: mod_perl "version" for Tomcat

2002-02-07 Thread Chuck Goehring



 
Thanks for the responses.  Just trying to find 
the simplest way to do things.
 
Chuck Goehring


mod_perl "version" for Tomcat

2002-02-06 Thread Chuck Goehring



 
 
Is there anyone out there working on a mod_perl 
"version" for Tomcat?  We currently have Apache running for mod_perl and 
Tomcat running for a purchased servlet library.  I primarily user mod_perl 
as a "speedup" for cgi programs.  I need ssl capabilities and have had 
problems trying to get it working.  Tomcat has an option for ssl from sun 
that may not have the issues on our platform.


Re: "Threading" on Win32

2001-02-12 Thread Chuck Goehring



Alistair
 
I believe this is because the Apache and mod_perl 
are threaded but the perl is not (optional/experimental).  So, the mod_perl 
serializes the use of perl.  Someday, it will be safe to use the options in 
the perl makefile to turn it on.
 
I'm on NT and 2000 as well and wish I wasn't. 

 
Chuck
 
 
Hi.  I'm running Apache 1.3.14, 
mod_perl 1.24_02 on Windows 2000 sp1, but I've seen this problem on other 
Win32 platforms.Basically, no matter how many "threads" are set up in 
httpd.conf, when a mod_perl URL is retreived, my apache will not service any 
other URLs until the mod_perl URL is finished.  Apache on its 
own is OK, I can (say) download two 4MB files simultaneously, but as soon as 
any mod_perl process gets going, all new URLS "hang" until it 
completes.  If a long download is going on and the mod_perl process 
starts, then the long download carries on AND the mod_perl one works, but 
any new URL doesn't get serviced, whether mod_perl or not.I'm 
running with the pre-built ActiveState perl (5.6.0; build 618), and the 
pre-built mod_perl at ftp://theoryx5.uwinnipeg.ca/pub/other/ 
(made by Randy Kobes), but I've seen this with a perl and a mod_perl that 
I've compiled myself, running on NT4.0. Is this a known problem, and 
are there any workarounds?  I'd be grateful for any 
info.Cheers,Alistair


Re: Strange problem with IE 5

2000-12-07 Thread Chuck Goehring

ek,

Had various similar problems with IE 5.0 and 5.5.  This was particularly
frequent with the first version of IE 5 released, when installed on w98.

BrowserMatch in srm.conf needs to be maintained for IE 5. I duped the entry
for IE 4.  This seams to fix most problems.

Chuck
- Original Message -
From: "ek" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 07, 2000 8:13 AM
Subject: Strange problem with IE 5


> Hello all,
> i'm trying to build a standard system: apache-1.3.14 with
> compiled in mod_perl-1.24_01 on RedHat linux 6.2
>
> If i build apache without mod_perl everything works fine. But if
> build apache with mod_perl, IE 5.0 fails to load pages from the
> server. I can only see blank page without any error message. This
> happens with all html documents - even static.
>
> The record in access_log:
>
> 192.168.2.11 - - [date] "GET /file.htm HTTP/1.1" 200 8731 "-"
> "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0")"
>
> Everything is fine except the byte count after the response
> code - its is always less than the actual document size.
>
> I tried to telnet to the server and use HEAD, GET, etc. -
> everything works fine.
>
> Trying 127.0.0.1...
> Connected to localhost.
> Escape character is '^]'.
> HEAD /file.htm HTTP/1.1
> HOST: 192.168.2.50
>
> HTTP/1.1 200 OK
> Date: Thu, 07 Dec 2000 18:58:26 GMT
> Server: Apache/1.3.14 (Unix) mod_perl/1.24_01
> Last-Modified: Wed, 06 Dec 2000 16:05:10 GMT
> ETag: "7e7-0-3a1ea9cb"
> Accept-Ranges: bytes
> Content-Length: 0
> Content-Type: text/html
>
> What could be wrong here? What should i check?
>
> Expecting help -
>
> ek.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Eval block error trapping bug????

2000-09-10 Thread Chuck Goehring

It was the "use CGI::Carp qw(fatalsToBrowser);".  Took it out and now all is
well. And eval block will work for my purposes - mostly trapping my own sql
generation errors.  I read up on $SIG{__DIE__} in the "Guide".  It may
become useful for me in the future.

Thanks for the quick info.

Chuck


-Original Message-
From: Eric L. Brine <[EMAIL PROTECTED]>
To: Chuck Goehring <[EMAIL PROTECTED]>
Cc: mod perl list <[EMAIL PROTECTED]>; [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Friday, September 08, 2000 9:58 PM
Subject: Re: Eval block error trapping bug


>> Under mod_perl, the die() within the eval block causes the
>> program to really die.
>
>Does your program (maybe CGI.pm or something used by CGI.pm?) set
>$SIG{'DIE'}? IIRC, $SIG{'DIE'} has precedence over eval{}, something
>many consider to be a bug.
>
>If so, I'd try:
>  eval {
>local $SIG{'DIE'}; # undefine $SIG{'DIE'} in this block
>...normal code...
>  };
>  if ($@) { ...normal code... }
>
>ELB




Eval block error trapping bug????

2000-09-08 Thread Chuck Goehring

Hi,

Having a big problem here.

When I use an eval{} block to trap dbi errors, it doesn't seam to work as
documented under mod_perl.
When I found this problem, I created a test program that connects, prepares
and executes a bogus sql
statement.  The $lsth->execute() || die $DBI::errstr; is triggering the
default "Software Error" message
and the cgi ends.  Toggling RaiseError changes the wording of the error
message but does not affect the
error trapping.  Under mod_perl, the die() within the eval block causes the
program to really die
even with RaiseError => 1.  I thought I had this all nailed down but now I
get un-gracefull error
handling in my web app.  The command line version works correctly.  Both
test programs and the
version info are listed below.

Deploying two major systems & need some help.  Any suggestions?

Thanks
Chuck Goehring
=

Versions are as follows:
Windows NT SP5
perl 5.6.0
Apache 1.3.12
ApacheDBI-0.87
mod_perl 1.24
DBD-Oracle-1.03
Dbi-1.13
Jserv 1.1.1
The manual fix for Carp in sub ineval was put in.
The manual fix for Carp::Heavy regarding 'DB'/'DB_tmp' was put in.

== startup.pl

use strict;
use Apache ();
use Apache::Registry;
use Apache::DBI();
use CGI qw(-compile :cgi);
use Carp();

1;
__END__

=== mod_perl test program
use strict;
my $cgiOBJ;
use CGI qw/:standard :html3/;
use CGI::Carp qw(fatalsToBrowser);
use Apache::DBI();
$cgiOBJ = new CGI;

print $cgiOBJ->header(-expires=>'-1d'),
  $cgiOBJ->start_html(-TITLE=>'Testing error handling',
  -BGCOLOR=>'#FF');
test3('select dork, pork, cork from rourk'); # A BOGUS sql statement.

print $cgiOBJ->end_html;

sub test3 {  # eval execute
  my ($aSQLStatement) = @_;
  print "test3: eval executeUsing SQL: $aSQLStatement";
  my ($dbh, $DefaultDSN, $user, $pa, $lsth);
  $DefaultDSN = 'DBI:Oracle:rciora';
  $user = 'dis';
  $pa = 'dis';

  $dbh = DBI->connect($DefaultDSN, $user, $pa, { RaiseError => 1, PrintError
=> 0, AutoCommit => 0 });   # Returns undef on failure (pg 86).
  eval {
$lsth = $dbh->prepare($aSQLStatement) or die "Prepare failed:
$DBI::errstr";
if (!(defined($lsth))) { # Prepare is supposed to return undef
on failure (pg 108).
  print 'lsth not defined at 1';  # This seams to never print for
Oracle.
}
$lsth->execute() || die $DBI::errstr; # die should trigger jump to 'if'
below.
  };
  if ($@) {   # $@ is null after an eval per camel page 161
print 'Message reported by @ = ' . $@;
  }
  if (!(defined($lsth))) { # Prepare is supposed to return undef on
failure (pg 108).
print 'sth not defined at 2';  # This seams to never print for Oracle.
  }
  $dbh->disconnect();
  return;
}

=== command line perl test program

use strict;
use DBI();

test3('select dork, pork, cork from rourk'); # A BOGUS sql statement.


sub test3 {  # eval execute
  my ($aSQLStatement) = @_;
  my ($dbh, $DefaultDSN, $user, $pa, $lsth);
  $DefaultDSN = 'DBI:Oracle:rciora';
  $user = 'dis';
  $pa = 'dis';

  $dbh = DBI->connect($DefaultDSN, $user, $pa, { RaiseError => 1, PrintError
=> 0, AutoCommit => 0 });   # Returns undef on failure (pg 86).
  eval {
$lsth = $dbh->prepare($aSQLStatement) or die "Prepare failed:
$DBI::errstr";
if (!(defined($lsth))) { # Prepare is supposed to return undef
on failure (pg 108).
  print "\nlsth not defined at 1";  # This seams to never print for
Oracle.
}
$lsth->execute() || die $DBI::errstr; # die should trigger jump to 'if'
below.
  };
  if ($@) {   # $@ is null after an eval per camel page 161
print "\nMessage reported by @ = $@";
  }
  if (!(defined($lsth))) { # Prepare is supposed to return undef on
failure (pg 108).
print "\nsth not defined at 2";  # This seams to never print for Oracle.
  }
  $dbh->disconnect();
  return;
}





Re: socket problems

2000-05-31 Thread Chuck Goehring


I had similar problems on Windows NT with mod_perl 1.16, Apache 1.3.3 and
perl 5.00502.  I was connecting to a Linux smtp server from a cgi on an NT
web server.  On NT, (netstat -s) it showed that "Reset Connections"
increased every time the connection failed.  It would work the very first
time after a re-start - then the would fail every time.   Worked fine from
comman-line Perl.  I'm now testing with perl 5.6.0, Apache 1.3.12 and
mod_perl 1.24 and don't have the problem.

Hope this helps.

Chuck Goehring

-Original Message-
From: Reilly, Thomas <[EMAIL PROTECTED]>
To: 'mod_perl' <[EMAIL PROTECTED]>
Date: Wednesday, May 31, 2000 4:22 AM
Subject: socket problems


>Hi,
> i'm using mod_perl to run a Unix domain socket client to connect to
>a server (wriiten in C). When i run the server and run the perl client as a
>stand-alone perl program it connects to the socket just fine and exchanges
>the relevant information. When i put the same lines into a mod_perl
program,
>I keep getting the following error in the error_log:
>
>null:Can't connect to /home/tom/ipc/echo_socket: Connection refused at
>/home/tom/ipc/mpipc.pl line21
>
>Here are the lines i use (which work for a standalone perl program!) in the
>script mpipc.pl
>
>use Apache::Request ();
>use Socket;
>use strict;
>
>my $r = shift;
>my $apr = Apache::Request->new($r);
>
>
> gather info from request obj here!
>
>
>socket(CLIENT,PF_UNIX,SOCK_STREAM,0);
>connect(CLIENT,sockaddr_un("/home/tom/ipc/echo_socket")) or die "Cant
>connect to /home/tom/ipc/echo_socket: $!";
>
>Above line is where the script fails as it can't connect! I set the
>permissions on the socket file to rwx for everybody!
>i.e. chmod 777 echo_socket
>but i still am refused a connection to it!
>(I also know IO::Socket may be an option but when i tried using it in a
>standalone perl program it absolutely refuses
>to connect to the C server)
>My question is does anybody know why i can't connect to this socket from a
>mod-perl script even though the above code connects fine from an ordinary
>perl program?
>
>Apache/1.3.12 (Red Hat linux)
>mod_perl/1.21
>Perl 5.00503
>
>Any help would be greatlt appreciated!
>
>Thomas.
>
>
>
>
>Thomas Reilly
>Software Consultant,
>
>Distributed Software Consultancy Ltd.,
>Ballybrit Business Park,Galway,Ireland.
>Tel: +353 (91) 760541 Fax: +353 (91) 760542
>e-mail: [EMAIL PROTECTED]
>web: http://www.dscie.com
>




Re: Problem: Apache/mod_perl/NT host won't close smtp connection

2000-05-25 Thread Chuck Goehring



This is a follow-up to my previous post for anyone who might 
have this problem and find this in the archives.
 
Firstly, the install was done correctly, I just lacked an 
understanding of the directory hierarchies.
The version used in my original post was the binary 
distribution of Apache+Perl+modperl from http://www.perl.com/CPAN/authors/Jeffrey_Baker/ (perl-5_005_02+apache1_3_3+modperl-1_16-bin-bindist1-i386-win32-vc5.zip).  
If you run the following command on the server, it will show an increasing value 
for "Reset Connections" each time the email send fails:
 
 C:\>netstat -s
 
TCP Statistics
  Reset 
Connections   
= 8I found old mod_perl list postings from Jun 1998 
where the poster had the same problem but no solution.
I found a reference to another build in my mail 
archives.  I downloaded the Randy Kobes binary distribution from ftp://theoryx5.uwinnipeg.ca/pub/other/ 
and ran it.  It has Perl-5.6.0, mod_perl-1.23, and Apache_1.3.12.  
Even though it does not have everything we need, I set it up to see if the port 
problem is there.  The problem does not occur with this build.
 
We need Oracle drivers built in for our use, so we decided to 
do our own build.  It seamed inevitable that we would need to learn to do 
this.  I've built from source with Perl-5.6.0, mod_perl-1.24, and 
Apache_1.3.12 and it does not have the problem.  It seams to be OK and the 
building went better than expected.
 
I have to assume the problem was caused somewhere in the 
low-level socket code but not sure whose.  The Microsoft web sites indicate 
patches where made in the TCP code in each NT service pack.  
 
Hope this helps somebody.
 
Chuck Goehring
[EMAIL PROTECTED]
 
 
 
 
 
 

  -Original Message-----From: 
  Chuck Goehring <[EMAIL PROTECTED]>To: 
  mod perl list <[EMAIL PROTECTED]>Date: 
  Monday, May 15, 2000 10:00 PMSubject: Problem: 
  Apache/mod_perl/NT host won't close smtp connection
   
  
   
  Having a 
  problem where the connections to an smtp server doesn't seam to close 
  correctly on Windows NT. I've tried two separate mailing modules (MIME::Lite 
  and Mail::Sender). Neither will send a second time without re-starting Apache. 
  The Lite module uses the Net::smtp module and the Sender directly uses a 
  Socket (not IO::Socket). Additional details are listed further down. My 
  general question is: Are there problems with "PERL" Sockets on mod_perl/NT? 
  Since a nearly identical test program works from the PERL.exe command line it 
  seams as if mod_perl is trying to keep the port open or 
  something.
   
  Also, there 
  are some directories that came with the Apache/mod_perl binary distribution 
  that have Socket.pm files in them. These directories are perl\lib\MSWin32-x86 
  and perl\lib\MSWin32-x86\IO. Should they have been copied over the other files 
  in the perl directory tree? Or, put in the startup.cgi(listing is at bottom)? 
  The distribution came with little docs and it was my first mod_perl 
  setup.
   
  Any 
  infomation would be greatly appreciated.  
   
   
  Chuck 
  Goehring
  [EMAIL PROTECTED]
   
  Below are more details of the problem I've been 
  having.
  --
  Details:
  I'm using 
  MIME::Lite to let users email files to other users as part of a document 
  management system. The MIME::Lite package inherits from Net::SMTP (@ISA = 
  qw(Net::SMTP);) and adds the capability to add attachments to the 
  email.
  It works fine 
  the first time but gives an error the second time. If I run it external to the 
  site via the perl.exe command line (with use CGI lines removed), it works 
  flawlessly every time. Once the error starts, even leaving it overnight 
  doesn't allow it to work. It acts as though the socket doesn't get closed and 
  can't be reused. Below are the pertinant scripts.
   
  --
  MIME::Lite 
  sub to send via smtp:
   
  sub 
  send_by_smtp {
   
  my ($self, 
  @args) = @_;
  # We need the 
  "From:" and "To:" headers to pass to the SMTP mailer:
  my $hdr = 
  $self->fields(); 
  my $from = 
  $self->get('From');
  my @to = 
  $self->get('To');
  # Create SMTP 
  client:
  require 
  Net::SMTP;
  my $smtp = 
  MIME::Lite::SMTP->new(@args)
  or croak 
  "Failed to connect to mail server: $!";
  $smtp->mail($from)
  or croak 
  "SMTP MAIL command failed: $!";
  $smtp->to(@to)
  or croak 
  "SMTP RCPT command failed: $!";
  $smtp->data()
  or croak 
  "SMTP DATA command failed: $!";
  # MIME::Lite 
  can print() to anything with a print() method:
  $self->print($smtp);
  $smtp->dataend();
  $smtp->quit;
  1;
  }
   
  --
  The Error 
  from MIME::Lite:
  [Sun May 14 
  16:20:10 20

Problem: Apache/mod_perl/NT host won't close smtp connection

2000-05-15 Thread Chuck Goehring




 

 
Having a 
problem where the connections to an smtp server doesn't seam to close correctly 
on Windows NT. I've tried two separate mailing modules (MIME::Lite and 
Mail::Sender). Neither will send a second time without re-starting Apache. The 
Lite module uses the Net::smtp module and the Sender directly uses a Socket (not 
IO::Socket). Additional details are listed further down. My general question is: 
Are there problems with "PERL" Sockets on mod_perl/NT? Since a nearly 
identical test program works from the PERL.exe command line it seams as if 
mod_perl is trying to keep the port open or something.
 
Also, there are 
some directories that came with the Apache/mod_perl binary distribution that 
have Socket.pm files in them. These directories are perl\lib\MSWin32-x86 and 
perl\lib\MSWin32-x86\IO. Should they have been copied over the other files in 
the perl directory tree? Or, put in the startup.cgi(listing is at bottom)? The 
distribution came with little docs and it was my first mod_perl 
setup.
 
Any infomation 
would be greatly appreciated.  
 
 
Chuck 
Goehring
[EMAIL PROTECTED]
 
Below are more details of the problem I've been 
having.
--
Details:
I'm using 
MIME::Lite to let users email files to other users as part of a document 
management system. The MIME::Lite package inherits from Net::SMTP (@ISA = 
qw(Net::SMTP);) and adds the capability to add attachments to the 
email.
It works fine 
the first time but gives an error the second time. If I run it external to the 
site via the perl.exe command line (with use CGI lines removed), it works 
flawlessly every time. Once the error starts, even leaving it overnight doesn't 
allow it to work. It acts as though the socket doesn't get closed and can't be 
reused. Below are the pertinant scripts.
 
--
MIME::Lite sub 
to send via smtp:
 
sub 
send_by_smtp {
 
my ($self, 
@args) = @_;
# We need the 
"From:" and "To:" headers to pass to the SMTP 
mailer:
my $hdr = 
$self->fields(); 
my $from = 
$self->get('From');
my @to = 
$self->get('To');
# Create SMTP 
client:
require 
Net::SMTP;
my $smtp = 
MIME::Lite::SMTP->new(@args)
or croak 
"Failed to connect to mail server: $!";
$smtp->mail($from)
or croak 
"SMTP MAIL command failed: $!";
$smtp->to(@to)
or croak 
"SMTP RCPT command failed: $!";
$smtp->data()
or croak 
"SMTP DATA command failed: $!";
# MIME::Lite 
can print() to anything with a print() method:
$self->print($smtp);
$smtp->dataend();
$smtp->quit;
1;
}
 
--
The Error from 
MIME::Lite:
[Sun May 14 
16:20:10 2000] -e: Failed to connect to mail server: Bad file descriptor at 
c:/apache/cgi-perl/test_sa_mime.cgi line 38 (Line 38 contains $SMTPRetVal = 
$msg->send_by_smtp($SMTPhost, Timeout => 40);
--
Configuration:
Windows NT 
service pack 4
Apache 1.3.3 
with mod_perl 1.16 binary from www.apache.org
cgi.pm 
2.42
Socket.pm 
1.6
Mime::Lite 
(Lite.pm,v 1.134 1999/04/17 04:59:03 eryq Exp) 
--
The test 
script:
$| = 
1;
## LIBS 
##
use 
strict;
use CGI 
qw/:standard :html3/;
use CGI::Carp 
qw(fatalsToBrowser); # carpout > # for Apache
use 
Apache::DBI();
use Apache 
qw(exit);
 
myRun();
Apache::exit;
 
 
 
##
sub myRun 
{
 
 
  print 
header();
  print 
start_html(-title => 'Mime test');
  print 
'This one should work.';
 
  use lib 
'c:\perl\lib\site\mime'; 
  use 
MIME::Lite;
  my 
($OpStatus, $recip, $SMTPRetVal);
  $recip = 
'[EMAIL PROTECTED]';
  print 
'TestMime: Starting test of Mime';
  my 
$SMTPhost = 'rcisd.com';
  print 
'TestMime: Host = ' . $SMTPhost;
  my 
$messbod = 'Testing mime module';
  my $Subj 
= 'TestMime';
  my $msg; 

  $msg = 
''; 
  $msg = 
build MIME::Lite From => '[EMAIL PROTECTED]',
    To => $recip, Subject => 
$Subj,
    Type => 'TEXT', Data => 
$messbod;
    print "TestMime: Recipient 
= $recip.";
  
eval{
    $SMTPRetVal = 
$msg->send_by_smtp($SMTPhost, Timeout => 40);
  
};
  if($@) 
{
    print "TestMime: Status 
after mail via $SMTPhost was: $@";
  
}
  
if($SMTPRetVal) {
  } else 
{
    print q(TestMime: Send Failed for ) . $recip . 
'';
  
}
  undef 
$msg;
  print 
'Done';
  print 
end_html();
  
return;
}
--
Apache 
startup.cgi:
use 
strict;
use Apache 
();
use 
Apache::Registry;
use 
Apache::DBI();
use 
Carp();
use CGI 
qw(-compile :all);
 
 
#use lib map { 
"$ENV{PWD}/blib/$_" } qw(arch lib);
#use lib map { 
Apache->server_root_relative("blib/$_") } qw(arch 
lib);
1;
__END__