Re: Pg_hba not using local setting

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Doug McNaught <doug(at)mcnaught(dot)org>
Cc: James Hall <James(dot)Hall(at)RadioShack(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Pg_hba not using local setting
Date: 2003-03-16 22:55:29
Message-ID: 1047855329.1344.37.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2003-03-14 at 18:48, Doug McNaught wrote:
> James Hall <James(dot)Hall(at)RadioShack(dot)com> writes:
>
> > Thanks for your response.
> >
> > I changed pg_hba.conf to include the server ip address as shown below:
> > ---
> > Local all trust
> > Host all 123.456.789.10 255.255.255.0
> > password
> > ---
> >
> > But still have the same result (users can login with any password if local
> > is set to trust). The web server is on the same machine as the database, no
> > java used.
> >
> > Did I misunderstand your comment regarding telling the webserver to connect
> > using an IP address?
>
> Yes.
>
> You need to set the webapp's database config to make it connect to
> an IP address instead of using the Unix socket (which it does by
> default for same-machine connections). I can't tell you how to do
> this because you haven't said what language/app server you're using
> for the website.

The webserver is on the same mahine and is not specifying a hostname
when it connects to PostgreSQL; therefore a Unix socket is used and the
local line in pg_hba.conf governs it. If you tell it to connect to
localhost, it will use TCP/IP instead. You then need a host line for
127.0.0.1.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"Bless them which persecute you; bless, and curse not.
Rejoice with them that do rejoice, and weep with them
that weep. Recompense to no man evil for evil. Provide
things honest in the sight of all men."
Romans 12:14,15,17

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Marc G. Fournier 2003-03-17 00:13:34 Re: [webmaster] Online docs down again
Previous Message Guillaume Houssay 2003-03-16 22:39:22 Data TYPE Creation