Обсуждение: problem in module Pg with Apache, Perl and SSL

Поиск
Список
Период
Сортировка

problem in module Pg with Apache, Perl and SSL

От
"BELLIARD Francois - FT.BD/FTRD/DRHG/RSCL"
Дата:
Hello

I have installed Postgresql on a Solaris8 Server with:
    - Apache 1.3.23,
    - mod_ssl-2.8.7-1.3.23
    - openSSL 0.9.6c,
    - PERL 5.6.1

When a Perl Cgi script tries to load the "Pg" module  (use Pg;  in the script),
there is the following error in the Apache Error Log :

Can't load '/usr/local/perl-5.6.1/lib/site_perl/5.6.1/sun4-solaris/auto/Pg/Pg.so' for module Pg: ld.so.1: /usr/local/perl-5.6.1/bin/perl: fatal: libssl.so.0.9.6: open failed: No such file or directory at /usr/local/perl-5.6.1/lib/5.6.1/sun4-solaris/DynaLoader.pm line 206.
at /home/www/smada/private/cgi-bin/latestChanges.pl line 2
Compilation failed in require at /home/www/smada/private/cgi-bin/latestChanges.pl line 2.
BEGIN failed--compilation aborted at /home/www/smada/private/cgi-bin/latestChanges.pl line 2

It looks like Perl is unable to load the module Pg for a reason that i don't understand.
All the libraries and modules specified in the error message exist on the server disk.
Is it a compilation or configuration problem ?
Thank you for your help.

-- 

François BELLIARD
FTR&D/DRHG/RSCL - (33) (0)2 96 05 22 51
 

Re: problem in module Pg with Apache, Perl and SSL

От
Morten Sickel
Дата:
BELLIARD Francois wrote:
[Snip]
>When a Perl Cgi script tries to load the "Pg" module  (use Pg;  in the
script),
>there is the following error in the Apache Error Log :
[Snip]

I cannot find any 'Pg' module at CPAN, but if you are using the DBD-Pg, you
are not supposed to have any 'use Pg;' in your code, but rather
use DBI;

and afterwards
$dbh = DBI->connect("dbi:Pg:dbname=$dbname", $dbuser, $dbpass)

(If you are using any other module, please have me excused, I am not using
Solaris so I am not able to try to reproduce your error messages.)


Best regards

Morten

--
Morten Sickel
Norwegian Radiation Protection Authority

Re: problem in module Pg with Apache, Perl and SSL

От
"Nigel J. Andrews"
Дата:
On Wed, 17 Apr 2002, Morten Sickel wrote:

> BELLIARD Francois wrote:
> [Snip]
> >When a Perl Cgi script tries to load the "Pg" module  (use Pg;  in the
> script),
> >there is the following error in the Apache Error Log :
> [Snip]
>
> I cannot find any 'Pg' module at CPAN, but if you are using the DBD-Pg, you
> are not supposed to have any 'use Pg;' in your code, but rather
> use DBI;

Or of course he could be using the Pg module :)

As for the problem of not finding the library file. You say they exist, you
presumably have checked they exist at the paths in the root filesystem the
error message mentions. Is your web server/cgi-bin program running in a chroot
box?


--
Nigel J. Andrews
Director

---
Logictree Systems Limited
Computer Consultants



Re: problem in module Pg with Apache, Perl and SSL

От
Morten Sickel
Дата:

> From: Nigel J. Andrews [mailto:nandrews@investsystems.co.uk]
> Morten Sickel (I) wrote:
>> I cannot find any 'Pg' module at CPAN, but if you are using the DBD-Pg...
> Or of course he could be using the Pg module :)

Oops, is there any? Sorry then, I searhed at cpan, withou finding any
modules named just Pg...

Morten

Re: problem in module Pg with Apache, Perl and SSL

От
Jie Liang
Дата:
module/category     current distrbution file
Pg            pgsql_perl5-1.9.0tar.gz

-----Original Message-----
From: Morten Sickel [mailto:Morten.Sickel@nrpa.no]
Sent: Thursday, April 18, 2002 5:50 AM
To: 'Nigel J. Andrews'; Pgsql-Admin (E-post)
Cc: 'BELLIARD Francois - FT.BD/FTRD/DRHG/RSCL'
Subject: Re: [ADMIN] problem in module Pg with Apache, Perl and SSL




> From: Nigel J. Andrews [mailto:nandrews@investsystems.co.uk]
> Morten Sickel (I) wrote:
>> I cannot find any 'Pg' module at CPAN, but if you are using the DBD-Pg...
> Or of course he could be using the Pg module :)

Oops, is there any? Sorry then, I searhed at cpan, withou finding any
modules named just Pg...

Morten

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Re: problem in module Pg with Apache, Perl and SSL

От
"BELLIARD Francois - FT.BD/FTRD/DRHG/RSCL"
Дата:
The web server is not chrooted and when Apache is started, the LD_LIBRARY_PATH variable points to all the directories containing the libraries
 

"Nigel J. Andrews" wrote:

On Wed, 17 Apr 2002, Morten Sickel wrote:

> BELLIARD Francois wrote:
> [Snip]
> >When a Perl Cgi script tries to load the "Pg" module  (use Pg;  in
the
> script),
> >there is the following error in the Apache Error Log :
> [Snip]
>
> I cannot find any 'Pg' module at CPAN, but if you are using the
DBD-Pg, you
> are not supposed to have any 'use Pg;' in your code, but rather
> use DBI;

Or of course he could be using the Pg module :)

As for the problem of not finding the library file. You say they exist,
you
presumably have checked they exist at the paths in the root filesystem
the
error message mentions. Is your web server/cgi-bin program running in a
chroot
box?

--
Nigel J. Andrews
Director

---
Logictree Systems Limited
Computer Consultants

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

-- 

François BELLIARD
FTR&D/DRHG/RSCL - (33) (0)2 96 05 22 51
 

Re: problem in module Pg with Apache, Perl and SSL

От
"BELLIARD Francois - FT.BD/FTRD/DRHG/RSCL"
Дата:
Hello,

Thank you for your information. I have tried it outside Apache.
The script works well when it is run by itself and if the user "nobody" has a correct
LD_LIBRARY_PATH.

Apache is started by the "root" user with a correct LD_LIBRARY_PATH and then the child
processes are run as "nobody" as specified in the httpd.conf file :
        User nobody
        Group nobody
It looks like the child process does not heritate the library path in its environment
when run inside Apache.

A normal perl script without "use Pg;" runs correctly in Apache
When using Pg, the error in Apache log is the following :
_____________
Can't load '/usr/local/perl-5.6.1/lib/site_perl/5.6.1/sun4-solaris/auto/Pg/Pg.so' for module Pg: ld.so.1:
/usr/local/perl-5.6.1/bin/perl: fatal: libssl.so.0.9.6: open failed: No such file or directory at
/usr/local/perl-5.6.1/lib/5.6.1/sun4-solaris/DynaLoader.pm line 206.
at /home/www/smada/private/cgi-bin/latestChanges.pl line 2
Compilation failed in require at /home/www/smada/private/cgi-bin/latestChanges.pl line 2.
BEGIN failed--compilation aborted at /home/www/smada/private/cgi-bin/latestChanges.pl line 2
-------------

François BELLIARD
FTR&D/DRHG/RSCL



"Nigel J. Andrews" wrote:
>
> OK, so if you use the Pg module outside of Apache, i.e. just in a normal
> perl
> script, do you get the same error or can the module be found?
>
> [I'm sorry, I see I snipped some of your original posting and I can't
> remember
> if you've already effectively answered this by saying it worked until
> you
> started using SSL]
>
> --
> Nigel J. Andrews
> Director
>
> ---
> Logictree Systems Limited
> Computer Consultants
>
> On Thu, 18 Apr 2002, BELLIARD Francois - FT.BD/FTRD/DRHG/RSCL wrote:
>
> > The web server is not chrooted and when Apache is started, the
> > LD_LIBRARY_PATH variable points to all the directories containing the
> > libraries
> >
> >
> > "Nigel J. Andrews" wrote:
> >
> > On Wed, 17 Apr 2002, Morten Sickel wrote:
> >
> > > BELLIARD Francois wrote:
> > > [Snip]
> > > >When a Perl Cgi script tries to load the "Pg" module  (use Pg;  in
> > the
> > > script),
> > > >there is the following error in the Apache Error Log :
> > > [Snip]
> > >
> > > I cannot find any 'Pg' module at CPAN, but if you are using the
> > DBD-Pg, you
> > > are not supposed to have any 'use Pg;' in your code, but rather
> > > use DBI;
> >
> >
> > Or of course he could be using the Pg module :)
> >
> >
> > As for the problem of not finding the library file. You say they
> exist,
> > you
> > presumably have checked they exist at the paths in the root filesystem
>
> > the
> > error message mentions. Is your web server/cgi-bin program running in
> a
> > chroot
> > box?
> >
> >
> >

--

Re: problem in module Pg with Apache, Perl and SSL

От
"BELLIARD Francois - FT.BD/FTRD/DRHG/RSCL"
Дата:
Hello,

I think my problem is resolved
In the httpd.conf file, i put the following directives :
    PassEnv  PATH
    PassEnv  LD_LIBRARY_PATH
and the error has disappeared.
The "mod_env" module must be loaded in Apache for it works.

Thank you for your help.

Francois



"BELLIARD Francois - FT.BD/FTRD/DRHG/RSCL" wrote:
>
> Hello,
>
> Thank you for your information. I have tried it outside Apache.
> The script works well when it is run by itself and if the user "nobody" has a correct
> LD_LIBRARY_PATH.
>
> Apache is started by the "root" user with a correct LD_LIBRARY_PATH and then the child
> processes are run as "nobody" as specified in the httpd.conf file :
>         User nobody
>         Group nobody
> It looks like the child process does not heritate the library path in its environment
> when run inside Apache.
>
> A normal perl script without "use Pg;" runs correctly in Apache
> When using Pg, the error in Apache log is the following :
> _____________
> Can't load '/usr/local/perl-5.6.1/lib/site_perl/5.6.1/sun4-solaris/auto/Pg/Pg.so' for module Pg: ld.so.1:
> /usr/local/perl-5.6.1/bin/perl: fatal: libssl.so.0.9.6: open failed: No such file or directory at
> /usr/local/perl-5.6.1/lib/5.6.1/sun4-solaris/DynaLoader.pm line 206.
> at /home/www/smada/private/cgi-bin/latestChanges.pl line 2
> Compilation failed in require at /home/www/smada/private/cgi-bin/latestChanges.pl line 2.
> BEGIN failed--compilation aborted at /home/www/smada/private/cgi-bin/latestChanges.pl line 2
> -------------
>
> François BELLIARD
> FTR&D/DRHG/RSCL
>
> "Nigel J. Andrews" wrote:
> >
> > OK, so if you use the Pg module outside of Apache, i.e. just in a normal
> > perl
> > script, do you get the same error or can the module be found?
> >
> > [I'm sorry, I see I snipped some of your original posting and I can't
> > remember
> > if you've already effectively answered this by saying it worked until
> > you
> > started using SSL]
> >
> > --
> > Nigel J. Andrews
> > Director
> >
> > ---
> > Logictree Systems Limited
> > Computer Consultants
> >
> > On Thu, 18 Apr 2002, BELLIARD Francois - FT.BD/FTRD/DRHG/RSCL wrote:
> >
> > > The web server is not chrooted and when Apache is started, the
> > > LD_LIBRARY_PATH variable points to all the directories containing the
> > > libraries
> > >
> > >
> > > "Nigel J. Andrews" wrote:
> > >
> > > On Wed, 17 Apr 2002, Morten Sickel wrote:
> > >
> > > > BELLIARD Francois wrote:
> > > > [Snip]
> > > > >When a Perl Cgi script tries to load the "Pg" module  (use Pg;  in
> > > the
> > > > script),
> > > > >there is the following error in the Apache Error Log :
> > > > [Snip]
> > > >
> > > > I cannot find any 'Pg' module at CPAN, but if you are using the
> > > DBD-Pg, you
> > > > are not supposed to have any 'use Pg;' in your code, but rather
> > > > use DBI;
> > >
> > >
> > > Or of course he could be using the Pg module :)
> > >
> > >
> > > As for the problem of not finding the library file. You say they
> > exist,
> > > you
> > > presumably have checked they exist at the paths in the root filesystem
> >
> > > the
> > > error message mentions. Is your web server/cgi-bin program running in
> > a
> > > chroot
> > > box?
> > >
> > >
> > >
>
> --

--

François BELLIARD
FTR&D/DRHG/RSCL - (33) (0)2 96 05 22 51