You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Mag Gam <ma...@gmail.com> on 2008/03/11 01:09:36 UTC

strange permission errors

Hi Gurus:

Moving my application from development to production server. For some
reason, I can't seem to execute my application when using mod_perl in
production. I keep getting this permission error:
[Mon Mar 10 13:47:33 2008] [error] Can't call method "prepare" on an
undefined value at /var/www/:app/index.pl line 26.\n
DBI connect('testdb','dbusr',...) failed: Couldn't connect to
/tmp/.s.PGSQL.5432: connect: Permission denied at
/usr/lib/perl5/site_perl/5.8.5/DBD/PgPP.pm line 124
 at /var/www/app/index.pl line 24
[Mon Mar 10 18:49:19 2008] [error] Can't call method "prepare" on an
undefined value at /var/www/app/index.pl line 26.\n
DBI connect('testdb','dbusr',...) failed: Couldn't connect to
/tmp/.s.PGSQL.5432: connect: Permission denied at
/usr/lib/perl5/site_perl/5.8.5/DBD/PgPP.pm line 124
 at /var/www/app/index.pl line 24
[Mon Mar 10 20:05:36 2008] [error] Can't call method "prepare" on an
undefined value at /var/www/app/index.pl line 26.\n



I am able to connect to my database using, psql -U dbusr testdb without any
problems. I actually gave my user and database full DB access. When I run
the program via CLI, it works. just not working thru mod_perl. Any
suggestions?

TIA

Re: strange permission errors

Posted by Mag Gam <ma...@gmail.com>.
Phillip:

The permissions are fine. I have default permissions for the Unix Socket. It
matched other postgresql installs, and other systems that work. Plus its the
default setting (srwxrwxrwx)..I still can't figure out why I am having this
problem...

Any help would be helpful


On Tue, Mar 11, 2008 at 2:47 PM, Philippe M. Chiasson <go...@ectoplasm.org>
wrote:

>
>
> Mag Gam wrote:
> > I get," The account is not currently available."
>
> That account has a disabled shell
>
> $> su apache -s `which sh` -c '/bin/ls /tmp/.s.PGSQL.5432'
>
> Look at the permissions on both /tmp and /tmp/.s.PGSQL.5432
>
> $> ls -ld /tmp
> $> ls -l /tmp/.s.PGSQL.5432
>
> --
> Philippe M. Chiasson     GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
> http://gozer.ectoplasm.org/       m/gozer\@(apache|cpan|ectoplasm)\.org/
>
>

Re: strange permission errors

Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.

Mag Gam wrote:
> I get," The account is not currently available."

That account has a disabled shell

$> su apache -s `which sh` -c '/bin/ls /tmp/.s.PGSQL.5432'

Look at the permissions on both /tmp and /tmp/.s.PGSQL.5432

$> ls -ld /tmp
$> ls -l /tmp/.s.PGSQL.5432

-- 
Philippe M. Chiasson     GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/       m/gozer\@(apache|cpan|ectoplasm)\.org/


Re: strange permission errors

Posted by Mag Gam <ma...@gmail.com>.
I get," The account is not currently available."

But this happens on good and bad configuration. The system it works on gives
me this error too..

Any other suggestion? The only difference I see is, in production I am using
mod_perl 1.99

On Tue, Mar 11, 2008 at 1:55 AM, Philippe M. Chiasson <go...@ectoplasm.org>
wrote:

> Mag Gam wrote:
> > Hi Gurus:
> >
> > Moving my application from development to production server. For some
> > reason, I can't seem to execute my application when using mod_perl in
> > production. I keep getting this permission error:
> > [Mon Mar 10 13:47:33 2008] [error] Can't call method "prepare" on an
> > undefined value at /var/www/:app/index.pl line 26.\n
> > DBI connect('testdb','dbusr',...) failed: Couldn't connect to
> > /tmp/.s.PGSQL.5432: connect: Permission denied at
> > /usr/lib/perl5/site_perl/5.8.5/DBD/PgPP.pm line 124
> >  at /var/www/app/index.pl line 24
> > [Mon Mar 10 18:49:19 2008] [error] Can't call method "prepare" on an
> > undefined value at /var/www/app/index.pl line 26.\n
> > DBI connect('testdb','dbusr',...) failed: Couldn't connect to
> > /tmp/.s.PGSQL.5432: connect: Permission denied at
> > /usr/lib/perl5/site_perl/5.8.5/DBD/PgPP.pm line 124
> >  at /var/www/app/index.pl line 24
> > [Mon Mar 10 20:05:36 2008] [error] Can't call method "prepare" on an
> > undefined value at /var/www/app/index.pl line 26.\n
>
> httpd runs as a non-root user, usually 'httpd' or 'apache'.
>
> Can that user access the PosgreSQL named pipe: /tmp/.s.PGSQL.5432
>
> $> su apache -c '/bin/ls /tmp/.s.PGSQL.5432'
>
> Should give you an idea what's up.
>
> --
> Philippe M. Chiasson     GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
> http://gozer.ectoplasm.org/       m/gozer\@(apache|cpan|ectoplasm)\.org/
>
>

Re: strange permission errors

Posted by "Philippe M. Chiasson" <go...@ectoplasm.org>.
Mag Gam wrote:
> Hi Gurus:
> 
> Moving my application from development to production server. For some 
> reason, I can't seem to execute my application when using mod_perl in 
> production. I keep getting this permission error:
> [Mon Mar 10 13:47:33 2008] [error] Can't call method "prepare" on an 
> undefined value at /var/www/:app/index.pl line 26.\n
> DBI connect('testdb','dbusr',...) failed: Couldn't connect to 
> /tmp/.s.PGSQL.5432: connect: Permission denied at 
> /usr/lib/perl5/site_perl/5.8.5/DBD/PgPP.pm line 124
>  at /var/www/app/index.pl line 24
> [Mon Mar 10 18:49:19 2008] [error] Can't call method "prepare" on an 
> undefined value at /var/www/app/index.pl line 26.\n
> DBI connect('testdb','dbusr',...) failed: Couldn't connect to 
> /tmp/.s.PGSQL.5432: connect: Permission denied at 
> /usr/lib/perl5/site_perl/5.8.5/DBD/PgPP.pm line 124
>  at /var/www/app/index.pl line 24
> [Mon Mar 10 20:05:36 2008] [error] Can't call method "prepare" on an 
> undefined value at /var/www/app/index.pl line 26.\n

httpd runs as a non-root user, usually 'httpd' or 'apache'.

Can that user access the PosgreSQL named pipe: /tmp/.s.PGSQL.5432

$> su apache -c '/bin/ls /tmp/.s.PGSQL.5432'

Should give you an idea what's up.

-- 
Philippe M. Chiasson     GPG: F9BFE0C2480E7680 1AE53631CB32A107 88C3A5A5
http://gozer.ectoplasm.org/       m/gozer\@(apache|cpan|ectoplasm)\.org/