Re: Trouble connecting to database using PQconnectdb (C/libpq) - Mailing list pgsql-general

From Tom Lane
Subject Re: Trouble connecting to database using PQconnectdb (C/libpq)
Date
Msg-id 7236.1263682456@sss.pgh.pa.us
Whole thread Raw
In response to Trouble connecting to database using PQconnectdb (C/libpq)  (Joel Alpers <joel@jkalpers.com>)
Responses Re: Trouble connecting to database using PQconnectdb (C/libpq)
List pgsql-general
Joel Alpers <joel@jkalpers.com> writes:
> New system:  Fedora 11, PostgreSQL 8.4

Fedora 11 enables selinux by default ...

> *** Error - Can't connect to database "photodb" - could not connect to server: Permission denied
>     Is the server running on host "192.168.111.7" and accepting
>     TCP/IP connections on port 5432?

Almost certainly, this represents selinux thinking that apache shouldn't
be making connections to random ports, and denying the socket open long
before it ever has a chance to get to postgres.

If you poke around in the selinux configuration options you can probably
find a switch that opens this up, but I don't know offhand what it is.

Or you could disable selinux, but if you're running a publicly visible
webserver I'd strongly recommend against that.  selinux will save your
bacon someday, but not if it's turned off.

            regards, tom lane

pgsql-general by date:

Previous
From: Joel Alpers
Date:
Subject: Trouble connecting to database using PQconnectdb (C/libpq)
Next
From: "Gauthier, Dave"
Date:
Subject: Read only column ?