localhost connects, same code on other host fails

From: "Reshat Sabiq" <sabiq(at)purdue(dot)edu>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: localhost connects, same code on other host fails
Date: 2003-01-01 06:16:19
Message-ID: 000101c2b15d$50795900$9c82d380@main
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

I have a Java web app that works just fine when deployed as localhost,
but gives a connection error:
IDENT authentication failed for user "myself"
and then throws an exception:
Connection could not be established.
when deploying the same app as a non-localhost (e.g., www.mydomain.com),
on the same server.

tcpip_socket is on. And we have this in pg_hba:
local all ident
sameuser
host all 127.0.0.1 255.0.0.0 ident
sameuser
host all xxx.yy.zzz.vv 255.255.255.255 ident
sameuser
host all 0.0.0.0 0.0.0.0 reject

where xxx.yy.zzz.vv stands for the IP in the DNS record with .tv
corporation.

In both cases, I'm connecting with the Linux network login and password,
so it probably is consistent with sameuser mode. That way I can connect
both from command line and from localhost-based app, but not as a
non-local-host.

P.S. It has to be something simple, like:
host all xxx.yy.zzz.vv 255.0.0.0 ident sameuser
perhaps. I'd appreciate any feedback on this.

P.P.S. The connectivity so far is straight-forward: no datasources, or
jndi.

P.P.P.S. The localhost-based app is running as myself on port 8080,
whereas the non-localhost-based app is running as root on port 80. Do I
perhaps have to have to be in the sudoers list for postgres to connect
when the server runs as root? I'm not connecting to system DBs, however.
I'm only connecting to my DB.

Thanks,
r.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2003-01-01 19:30:31 Re: localhost connects, same code on other host fails
Previous Message hodges 2003-01-01 04:24:21 Re: passing variables