localhost connects, same code on other host fails - Mailing list pgsql-novice

From Reshat Sabiq
Subject localhost connects, same code on other host fails
Date
Msg-id 000101c2b15d$50795900$9c82d380@main
Whole thread Raw
In response to Re: passing variables  (hodges@xprt.net)
Responses Re: localhost connects, same code on other host fails  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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.



pgsql-novice by date:

Previous
From: hodges@xprt.net
Date:
Subject: Re: passing variables
Next
From: Tom Lane
Date:
Subject: Re: localhost connects, same code on other host fails