robert rottermann
2015-Mar-15 07:52 UTC
[CentOS] centos 7 database access only possible trough localhost and not IP
Hi there and hello to everybody, I am all new to centos but I have good experience working with ubuntu and suse. We are moving a an elderly SuSe box to a virtual machine running centos 7. Now I experience the following problem. I can only access postgres using localhost as host. If I use the IP address (even 127.0.0.1). I found a similar problem when accessing the host using http. There I found out (after lots of hair pulling) that I have to set a value using setsebool. So I assume, that I have a similar problem here. I would be grateful, if somebody could point me in the right direction .. thanks robert
Laurent CREPET
2015-Mar-15 08:03 UTC
[CentOS] centos 7 database access only possible trough localhost and not IP
Hi Robert, I have almost no experience with CentOS 7(still using CentOS 6). However, I recommed the following checks: 1. Check that PostgreSQL is listening on 0.0.0.0 (all ip addresses) and not 127.0.0.1. To check, you can use the command: netstat -tuplan If PostgreSQL is listening only on 127.0.0.1, you'll never be able to connect to it from the network. You'll have to change the PostgreSQL settings. 2. Check that iptables (firewall) is allowing the connections from the network to PostgreSQL. Use the following command to get the list of rules that are currently loaded: iptables -L Regards, Laurent. 2015-03-15 8:52 GMT+01:00 robert rottermann <robert at redcor.ch>:> Hi there and hello to everybody, > > > > I am all new to centos but I have good experience working with ubuntu and > suse. > We are moving a an elderly SuSe box to a virtual machine running > centos 7. > Now I experience the following problem. > I can only access postgres using localhost as host. If I use the IP > address > (even 127.0.0.1). > I found a similar problem when accessing the host using http. There I > found out > (after lots of hair pulling) that I have to set a value using > setsebool. > So I assume, that I have a similar problem here. > I would be grateful, if somebody could point me in the right direction > .. > thanks > robert > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >-- Laurent. crepetl at gmail.com / root at tnpl127.net
Earl A Ramirez
2015-Mar-15 08:09 UTC
[CentOS] centos 7 database access only possible trough localhost and not IP
On 15 March 2015 at 03:52, robert rottermann <robert at redcor.ch> wrote:> Hi there and hello to everybody, > > > > I am all new to centos but I have good experience working with ubuntu and > suse. > We are moving a an elderly SuSe box to a virtual machine running > centos 7. > Now I experience the following problem. > I can only access postgres using localhost as host. If I use the IP > address > (even 127.0.0.1). > I found a similar problem when accessing the host using http. There I > found out > (after lots of hair pulling) that I have to set a value using > setsebool. > So I assume, that I have a similar problem here. > I would be grateful, if somebody could point me in the right direction > .. > thanks > robert > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos >Hello Robert, See if this will help [0], by default it appears to be listening for localhost only "listen_addresses='localhost'". [0] http://www.cyberciti.biz/tips/postgres-allow-remote-access-tcp-connection.html -- Kind Regards Earl Ramirez
John R Pierce
2015-Mar-15 08:24 UTC
[CentOS] centos 7 database access only possible trough localhost and not IP
On 3/15/2015 1:03 AM, Laurent CREPET wrote:> 2. Check that iptables (firewall) is allowing the connections from the > network to PostgreSQL. Use the following command to get the list of rules > that are currently loaded: > > iptables -LI usually use iptables -L -vn to see the full rules and what they are doing. the default -L display is missing important bits. -- john r pierce 37N 122W somewhere on the middle of the left coast
robert rottermann
2015-Mar-15 08:41 UTC
[CentOS] centos 7 database access only possible trough localhost and not IP
thanks very much to everybody, it was in deed the fact, that postgres was only listening to localhost. robert On 15.03.2015 08:52, robert rottermann wrote:> Hi there and hello to everybody, > > > > I am all new to centos but I have good experience working with ubuntu and suse. > We are moving a an elderly SuSe box to a virtual machine running centos 7. > Now I experience the following problem. > I can only access postgres using localhost as host. If I use the IP address > (even 127.0.0.1). > I found a similar problem when accessing the host using http. There I > found out > (after lots of hair pulling) that I have to set a value using setsebool. > So I assume, that I have a similar problem here. > I would be grateful, if somebody could point me in the right direction .. > thanks > robert > > _______________________________________________ > CentOS mailing list > CentOS at centos.org > http://lists.centos.org/mailman/listinfo/centos