Re: problem connecting to postgres via apache

From: Susan Cassidy <susan(dot)cassidy(at)decisionsciencescorp(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: problem connecting to postgres via apache
Date: 2014-01-24 16:13:19
Message-ID: CAE3Q8onVfnHVJKEQGhUNj1foy18f-jsGbEH4tBtQ=Art-YDuig@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

$dbh = DBI->connect("dbi:Pg:dbname=$dbname;host=${dbserver};port=$dbport;",
$dbuser, $dbpasswd) or
errexit( "Unable to connect to dbname $dbname, err: $DBI::errstr");

The exact same connection string works fine in a standalone perl program.

Susan

On Thu, Jan 23, 2014 at 3:08 PM, Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>wrote:

> On 01/23/2014 02:55 PM, Susan Cassidy wrote:
>
>> I'm having a problem connecting to postgres via a CGI program. I can
>> connect just fine using the same connect string in a non-cgi perl
>> program as in the perl cgi program. The error I get is this:
>>
>>
>> ERROR: Unable to connect to dbname testdb2, err: could not
>> connect to server: Permission denied
>> Is the server running on host "jacensolo.red.dsic.com
>> <http://jacensolo.red.dsic.com>" (192.168.10.16) and accepting
>> TCP/IP connections on port 5432?
>>
>
> FYI, in the future you might want to anonymize your host information. For
> example xxx.yyy.zzz.com
>
> Well from the above it looks like you where trying to connect using TCP/IP
> not a socket.
>
> What is your connection string?
>
>
>> I tried adding postgres to the apache user's groups, because I saw
>> something on google that said that that is needed for the socket
>> connection to work, but it didn't help.
>>
>> I just tried stopping and restarting apache, and when I try to start I
>> get this:
>>
>>
>> apachectl start
>> (13)Permission denied: make_sock: could not bind to address [::]:80
>> (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
>> <http://0.0.0.0:80>
>> no listening sockets available, shutting down
>> Unable to open logs
>>
>> I took away the group permission for postgres, just in case that had
>> messed up something, but it didn't help. Now I can't even start apache.
>>
>
> To me it looks like it is already running.
>
>
>>
>> Susan
>>
>>
>>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)gmail(dot)com
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2014-01-24 16:28:24 Re: problem connecting to postgres via apache
Previous Message Jim Mlodgenski 2014-01-24 15:58:36 Re: postgres-fdw questions