apache/mod_perl/dbi - problem

1999-12-13 Thread Volker Hess

Hi,

I use to servers with nearly the same configuration:

host 1:

   Embedded Perl version 5.00503 for Apache/1.3.9 (Unix) Debian/GNU
   AuthPostgreSQL/0.7.1 mod_perl/1.21 process 255,
   running since Mon Dec 13 10:57:03 1999

   completely using debian packages

host 2:

   Embedded Perl version 5.00503 for Apache/1.3.9 (Unix) Debian/GNU
   mod_perl/1.21 process 4967,
   running since Sun Dec 12 07:35:09 1999

   mod_perl compiled as DSO using apxs by myself

I wrote a CGI-script connecting to a postgreSQL database.
The script run's well in CGI.pm's offline mode. Also it does his
job on host 2 using Apache::PerlRun _and_ Apache::Registry.
On host 1 with Apache::Registry the script crashes with:

[Mon Dec 13 16:44:23 1999] [error] Cannot connect to 'dbi:Pg:dbname=spix 
postgres' at /home/staufenberg/webroot/htdocs/Bilder/archiv/img.cgi line 38.

I found the same problems with any HTML::Embperl page using DBI/DBD::pg.

Please could you give me an advice where to start debugging?!
Thanx!!!

Volker
-- 
EMail: Volker Hess [EMAIL PROTECTED] 
Uni-GH Siegen . Medienzentrum
57068 Siegen
MZ: http://www.avmz.uni-siegen.de/





Re: apache/mod_perl/dbi - problem

1999-12-13 Thread Stas Bekman

On Mon, 13 Dec 1999, Volker Hess wrote:

 Hi,
 
 I use to servers with nearly the same configuration:
 
 host 1:
 
Embedded Perl version 5.00503 for Apache/1.3.9 (Unix) Debian/GNU
AuthPostgreSQL/0.7.1 mod_perl/1.21 process 255,
running since Mon Dec 13 10:57:03 1999
 
completely using debian packages
 
 host 2:
 
Embedded Perl version 5.00503 for Apache/1.3.9 (Unix) Debian/GNU
mod_perl/1.21 process 4967,
running since Sun Dec 12 07:35:09 1999
 
mod_perl compiled as DSO using apxs by myself
 
 I wrote a CGI-script connecting to a postgreSQL database.
 The script run's well in CGI.pm's offline mode. Also it does his
 job on host 2 using Apache::PerlRun _and_ Apache::Registry.
 On host 1 with Apache::Registry the script crashes with:
 
 [Mon Dec 13 16:44:23 1999] [error] Cannot connect to 'dbi:Pg:dbname=spix 
 postgres' at /home/staufenberg/webroot/htdocs/Bilder/archiv/img.cgi line 38.

Doesn't it print the reason for the failure? Is your code looking like:

man DBI:
 $dbh = DBI-connect($data_source, $username, $password)
   || die $DBI::errstr;

I mean, do you use $DBI::errstr?

It can be a permission problem, your script is running under the username
of the server... 

 
 I found the same problems with any HTML::Embperl page using DBI/DBD::pg.
 
 Please could you give me an advice where to start debugging?!
 Thanx!!!
 
 Volker
 -- 
 EMail: Volker Hess [EMAIL PROTECTED] 
 Uni-GH Siegen . Medienzentrum
 57068 Siegen
 MZ: http://www.avmz.uni-siegen.de/
 
 
 
 



___
Stas Bekmanmailto:[EMAIL PROTECTED]  http://www.stason.org/stas
Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC
perl.apache.orgmodperl.sourcegarden.org   perlmonth.comperl.org
single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com



Re: apache/mod_perl/dbi - problem

1999-12-13 Thread Volker Hess

Thanx Stas,

 Doesn't it print the reason for the failure? Is your code looking like:
 
 man DBI:
  $dbh = DBI-connect($data_source, $username, $password)
|| die $DBI::errstr;
 
 I mean, do you use $DBI::errstr?
 
 It can be a permission problem, your script is running under the username
 of the server... 
 
Yes, apache really says:

DBI-connect failed: connectDB() -- connect() failed: Connection refused
Is the postmaster running at 'localhost' and accepting connections on Unix 
socket '5432'?

But this problem only occurs while running under mod_perl. Offline and
with PerlRun all seems OK. PostgreSQL + database is open on both hosts
via port 5432. Also I found nothing like:

  No pg_hba.conf entry for host 141.99.3.17, user volker, database spix

in postgres.log.


-- 
EMail: Volker Hess [EMAIL PROTECTED] 
Uni-GH Siegen . Medienzentrum
57068 Siegen
MZ: http://www.avmz.uni-siegen.de/