Re: Trouble connecting to database using PQconnectdb (C/libpq)

From: Joel Alpers <joel(at)jkalpers(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Trouble connecting to database using PQconnectdb (C/libpq)
Date: 2010-01-17 03:23:37
Message-ID: 4B5282B9.8090406@jkalpers.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Joel Alpers <joel(at)jkalpers(dot)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
>
>
Tom:

Thanks for the quick reply - looks like you were spot on with your analysis.

I temporarily set selinix to "permissive" and the web page works as it
should.

Now the trick will be to find a way to make them play well together -- I'll
check the postgres site where they have discussions archived...

Thanks again!!!

Joel.

--

+--------------------------------------------------------------------+
| Joel K. Alpers
| Expressive Black and White Images
| http://www.jkalpers.com
+--------------------------------------------------------------------+

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2010-01-17 03:34:33 Re: Trouble connecting to database using PQconnectdb (C/libpq)
Previous Message Tom Lane 2010-01-17 02:21:26 Re: Read only column ?