I have postgresql up and running but when I try to connect via apache to postgresql I get an error:
[error] [client 127.0.0.1] DBI connect('dbname=template1','sql-ledger',...) failed: could not connect to server: Permission denied, referer:
http://localhost/sql-ledger/admin.pl
On Dec 15, 2011 10:55 AM, "Joseph" <syscon780@gmail.com> wrote:
>
> I have postgresql up and running but when I try to connect via apache to
postgresql I get an error:
>
> [error] [client 127.0.0.1] DBI
connect('dbname=template1','sql-ledger',...) failed: could not connect to
server: Permission denied, referer: http://localhost/sql-ledger/admin.pl
>
> Anybody knows what to look for?
>
> --
> Joseph
>
Check pg_hba.conf
Rgds,
I did, it is identical to my other working systems:
local all all trust
here are other details:
# psql -p 5432 -U postgres
psql (9.1.1)
Type "help" for help.
postgres=#
Available PostgreSQL Slots
9.1 * server-9.1.1 base-9.1.1
> here are other details:
>
> # psql -p 5432 -U postgres
> psql (9.1.1)
> Type "help" for help.
>
> postgres=#
> Available PostgreSQL Slots
> A 9.1 * A A A A A A A A A A A server-9.1.1 base-9.1.1
>
Hmmm...
Have you GRANT the 'sql-ledger' user the CONNECT privilege to the
database?
Okay, according to the documentation on GRANT, "=c/postgres" means the public is granted "CONNECT" privilege, granted by the user postgres. So no problem there.
> Okay, according to the documentation on GRANT, "=c/postgres" means the public is granted "CONNECT" privilege, granted by the user postgres. So no problem there.
>
> Hmm... wonder what's wrong...
>
Okay, I'm grasping at straws currently... how does the offending line in admin.pl look like?
> > Okay, according to the documentation on GRANT, "=c/postgres" means the public is granted "CONNECT" privilege, granted by the user postgres. So no problem there.
> >
> > Hmm... wonder what's wrong...
> >
>
> Okay, I'm grasping at straws currently... how does the offending line in admin.pl look like?
>
> Rgds,
Some thoughts : if the line is correct, the problem might be in how you configured Apache. Here's a reference :
>
> Okay, according to the documentation on GRANT, "=c/postgres" means the
public is granted "CONNECT" privilege, granted by the user postgres. So no
problem there.
>
> Hmm... wonder what's wrong...
>
Okay, I'm grasping at straws currently... how does the offending line in
admin.pl look like?
Rgds,
Hi Pandu,
Thanks for helping out on this. I'm pulling my hair trying to figure it out and I'm getting nowhere.
The SQL-Ledger developer was helping me out on this and he can not figure it out either.
I'm sure it is not SQL-ledger as it is working perfectly on my other computers. It could be apache configuration, but I don't see how?
I've compared file (using meld) setup with my working server and they are the same.
So it could be something do to with permission. As I copied apache configuration file using "meld" and meld program does not preserve ownership.
Here is amdin.pl script from SQL-Ledger
#!/usr/bin/perl -X
#
################################################## ####################
# SQL-Ledger ERP
# Copyright (C) 2006
#
# Author: DWS Systems Inc.
# Web: http://www.sql-ledger.com
#
################################################## #####################
#
# this script sets up the terminal and runs the scripts
# in bin/$terminal directory
# admin.pl is linked to this script
#
################################################## #####################