From: | John R Pierce <pierce(at)hogranch(dot)com> |
---|---|
To: | Kostadin Solakov <kostadin(dot)solakov(at)gmail(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: PostgreSQL on Webmin |
Date: | 2009-03-16 01:25:29 |
Message-ID: | 49BDAA89.3010209@hogranch.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Kostadin Solakov wrote:
>
> Hi there!
>
> I just installed Webmin on my dedicated server and I really had hard
> time making all configuration that were needed to migrate my site.
> Anyway, now everything is working except for one thing. I can’t
> connect to the database through PHP. Remote connection is working
> fine, but local doesn’t.
>
> The connection string looks like this:
>
> pg_connect('host=localhost port=5432 user=user password=pass dbname=db')
>
> I made the necessary changes in postgresql.conf
>
> listen_addresses = '*'
>
> port=5432
>
> And I added this in pg_nba.conf:
>
> local all all trust
>
> local all user ident sameuser
>
> local db user password
>
> But still I cannot connect using php. The connection file is the same
> as it was on my previous host (shared one) so it’s supposed to be working.
>
> I created the same database and user.
>
the first local all all takes precedence as that matches any local
(domain socket) connections. as is, you're saying any process running
your server can connect to any database as any user with no
authorization required.
however, none of those lines affect localhost IP connections, those
instead would match a `host .... 127.0.0.1/32 ....`
I most typically use the following...
local all all ident sameuser # allow local domain connections to
authenticate only as themselves
host all all 127.0.0.1/32 md5 # allow localhost IP connections to
authenticate with passwords only
and sometimes...
host all all my.ip.sub.net/24 md5 # allow any user on my IP subnet to
authneticate with passwords
From | Date | Subject | |
---|---|---|---|
Next Message | ataherster | 2009-03-16 01:29:16 | [Fwd: Re: [ask] Return Query] |
Previous Message | John R Pierce | 2009-03-16 00:06:04 | Re: Oracle to PostgreSQL |