Thread: pg_hba.conf not right

pg_hba.conf not right

From
Phillip Smith
Date:
Hi all,

Not sure what I've done (an automatic yum update I suspect!) but my Drupal
site recently died. Traced the problem back to this error in PostgreSQL:
   ESTLOG:  connection received: host=::1 port=37822
   ESTFATAL:  no pg_hba.conf entry for host "::1", user "drupal", database "drupal", SSL off

This PostgreSQL server purely exists these days to run Drupal, and I
haven't touched the config since I set it up - I suspect a yum update
changed something to do with the way Apache or PHP talks to PG. I compiled
PG from source so yum hasn't touched PG.

Here's my pg_hba.conf:
   [root@poweredge2400 data]# cat pg_hba.conf
   # PostgreSQL Client Authentication Configuration File
   # ===================================================
   #

   # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
   local   all         all                               trust
   host    all         all         127.0.0.1/32          trust

   host    all             all     192.168.1.0/24          md5
   host    all             all     172.20.0.0/18           md5

I've managed to get my site running again by telling it to connect to PG
via the 192.168.0.0/24 interface instead of 'localhost'

If I su to 'apache' and run 'psql drupal drupal' it connects fine. What's
been buggered up?

Cheers,
~p

--
Phillip Smith
phillips@fukawi2.homelinux.net

Re: pg_hba.conf not right

From
Devrim GÜNDÜZ
Date:
Hi,

On Tue, 2007-09-25 at 22:39 +1000, Phillip Smith wrote:
>    ESTFATAL:  no pg_hba.conf entry for host "::1", user "drupal",
> database "drupal", SSL off

You need to enable IPV6 in pg_hba.conf:

host  drupal drupal  ::1/128 trust

and reload PostgreSQL.

Regards,

--
Devrim GÜNDÜZ
PostgreSQL Replication, Consulting, Custom Development, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, ODBCng - http://www.commandprompt.com/



Attachment

Re: pg_hba.conf not right

From
Phillip Smith
Date:
On Tue, 25 Sep 2007, Devrim GÜNDÜZ wrote:

> You need to enable IPV6 in pg_hba.conf:
>
> host  drupal drupal  ::1/128 trust

I thought it was something like that... Now that's I've taken a second
look, it seems the yum update did this to /etc/hosts:
   [phillips@poweredge2400 ~]$ cat /etc/hosts
   # Do not remove the following line, or various programs
   # that require network functionality will fail.
   127.0.0.1               poweredge2400 localhost.localdomain localhost
   ::1             poweredge2400 localhost.localdomain localhost

So localhost resolved according to the last line to the IPv6 address,
instead of the IPv4 address.

Thanks :)
~p

--
Phillip Smith
phillips@fukawi2.homelinux.net