Re: apache permission denied

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-general(at)postgresql(dot)org, ccosner(at)stanford(dot)edu
Subject: Re: apache permission denied
Date: 2008-07-10 18:34:54
Message-ID: 200807102034.54673.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Am Donnerstag, 10. Juli 2008 schrieb Chris Cosner:
> Using RHEL 5, with Postgresql 8.1, Apache, mod_perl, mod_auth_pgsql,
> DBI, DBD::Pg
>
> Perl cgi scripts that access the database get the following in httpd
> error_log:
> DBI connect('dbname=db','',...) failed: could not connect to server:
> Permission denied

An strace of the program would probably give definite insight, but "Permission
denied" sounds to me like a file system error message. Possibly, you don't
have proper permissions (at least u+x) on the socket file (in (/tmp). But
you would have to have done serious "customization" to get to that state.
Mayb you have some fancy security configured around your Apache instance?

> A direct test with a simple SQL command in the file, "command"
> # sudo -u apache psql db < command
> psql: FATAL: role "apache" is not permitted to log in

That is a different issue, which the DBI route above would likely also
complain about if it managed to get by the Permission denied stage.

> At the psql command line, \z shows
> apache=arwdRxt
> for all tables

That is yet another different issue :) which will only matter once the apache
role manages to log in and try to read a table.

> And httpd.conf definitely has
> User apache
> Group apache
>
> I have restarted httpd and postmaster and the machine. These scripts
> work with postgresql 7x, but the grant syntax is different in 8x, so I
> wonder if the problem is how to grant apache privileges, or some extra
> step I'm missing.

Note that "postgresql 7x" and "8x" are about as useful classifications
as "Linux 1" and "Linux 2". Please be more precise. Yes, somewhere along
the line the syntax did change, but if that were the problem, you would get
an error message about it.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marc Munro 2008-07-10 18:39:53 Re: pgmemcache status
Previous Message Ismael Almaraz Ezparza 2008-07-10 18:18:10 Re: storing latitude and longitude