Thread: connecting to linux server from windows xp

connecting to linux server from windows xp

From
Sebastian Scarano
Date:
Hello everybody

I'm giving my first steps with postgresql.

I installed it on a gentoo box and it's working fine. I can connect to it via pgadmin3 with server: localhost (or tux, as it's configured in my /etc/conf.d/hostname) and port 5432

I also installed vmware to run an xp SP1 box inside it.

I have conectivity between the gentoo host and the xp guest. I can ping each other. (but I can't ping by the machine name, just by the ip)

But I don't know how to connect from the xp guest to the postgresql server running on the gentoo host.

Putting "tux" in the server name, didn't work.

I tried with every ip address on the host (I have a couple, one is the vmnet8 interfase used for NAT net board emulation and the other is vmnet1 used for the host only network connection)

Any ideas???

Saludos

Sas

Re: connecting to linux server from windows xp

From
Andreas Kretschmer
Date:
Sebastian Scarano <opensas@gmail.com> schrieb:
> But I don't know how to connect from the xp guest to the postgresql server
> running on the gentoo host.
>
> Any ideas???

Yes, edit your pg_hba.conf - file. This file contains rules for
client-access. It is self-explanatory by comments.
By default PG don't allow access via network. And, of cource, PG should
listen on the interface, check this in the postgresql.conf, line
'listen_addresses = ...'.


HTH, Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

Re: connecting to linux server from windows xp

From
Sebastian Scarano
Date:
With the help of Andreas, I could finally connect a from a guest xp running with vmware inside a host xp machine

Now I'm trying to do the same with a host gentoo box and a guest xp SP1

this is my pg_hba.conf

---
tux data # cat pg_hba.conf | tail -n 8

# "local" is for Unix domain socket connections only
local   all         all                               trust
# IPv4 local connections:
host    all         all         127.0.0.1/32          trust
host    all         all         192.168.0.0/16        md5
# IPv6 local connections:
host    all         all         ::1/128               trust
---

my postgresql.conf

---

tux data # cat postgresql.conf | grep listen
# "pg_ctl reload". Some settings, such as listen_address, require
listen_addresses = '*'
#listen_addresses = 'localhost' # what IP interface(s) to listen on;

---

and my /etc/conf.d/postgresql

---

tux data # cat /etc/conf.d/postgresql
# PostgreSQL's Database Directory
PGDATA=/var/lib/postgresql/data

# Logfile path: (NOTE: This must be uid/gid owned by the value of $PGUSER!)
PGLOG=/var/lib/postgresql/data/postgresql.log

# Run the PostgreSQL user as:
PGUSER=postgres

# Extra options to run postmaster with.
# If you want to enable TCP/IP for PostgreSQL, add -i to the following:
#PGOPTS="-N 1024 -B 2048 -i"
PGOPTS="-i"
---

I have the xp guest configured to use NAT network connection, and in the host file I've configured the ip address of the host.

I can ping each other by ip address or name, thanks to the hosts file in both machines

----

(pinging from the host)

tux data # ping xp
PING xp (192.168.103.128) 56(84) bytes of data.
64 bytes from xp (192.168.103.128): icmp_seq=1 ttl=128 time=1.42 ms
64 bytes from xp (192.168.103.128): icmp_seq=2 ttl=128 time=0.148 ms

---

When I try to connect from the host using pgaminIII for windows, I get the following error:

"Server not listening"

Am I missing something???




Re: connecting to linux server from windows xp

From
"A. Kretschmer"
Date:
am  14.11.2005, um  6:17:49 -0300 mailte Sebastian Scarano folgendes:
> With the help of Andreas, I could finally connect a from a guest xp running
> with vmware inside a host xp machine
>
> Now I'm trying to do the same with a host gentoo box and a guest xp SP1
>
> this is my pg_hba.conf
>
> ---
> tux data # cat pg_hba.conf | tail -n 8
>
> # "local" is for Unix domain socket connections only
> local all all trust
> # IPv4 local connections:
> host all all 127.0.0.1/32 <http://127.0.0.1/32> trust
> host all all 192.168.0.0/16 <http://192.168.0.0/16> md5
                              ^^^^^^^^^^^^^^^^^^^^^^
                              wrong syntax


>
> When I try to connect from the host using pgaminIII for windows, I get the
> following error:
>
> "Server not listening"

1. wrong syntax in pg_hba.conf
2. check, if the server ist running (telnet server 5432, it should
   connect for a few seconds)

My guess: because the wrong syntax the server is not running.


HTH, Andreas
--
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47212,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    ===

Re: connecting to linux server from windows xp

From
Sebastian Scarano
Date:
Hi

I think that the browser is adding some http:// stuff in front of my
ip addresses config.

I'll replace the dots "." with hypens "-". You'll see there's no
"http://" anywhere to be found...

---

tux data # cat pg_hba.conf | tail -n 9
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               trust
# IPv4 local connections:
host    all         all         127-0-0-1/32          trust
host    all         all         192-168-0-0/16        password
# IPv6 local connections:
host    all         all         ::1/128               trus
---

From the windows xp guest I opend a shell and tried with

telnet tux 5432 but it couldn't connect

So I tried with telnet 192.168.103.1 5432 and it did connected for a
few seconds.

And the, back to pgadminIII, i replaced tux with the ip address and I
could connect!!!!

Anyway, I'd like to know why I can connect from a windowx xp client to
a postgresql server running con a windows xp with the server name, but
with a server running in linux I have to use the ip address

Saludos and thanks

Sas


On 11/14/05, A. Kretschmer <andreas.kretschmer@schollglas.com> wrote:
> am  14.11.2005, um  6:17:49 -0300 mailte Sebastian Scarano folgendes:
> > With the help of Andreas, I could finally connect a from a guest xp
> running
> > with vmware inside a host xp machine
> >
> > Now I'm trying to do the same with a host gentoo box and a guest xp SP1
> >
> > this is my pg_hba.conf
> >
> > ---
> > tux data # cat pg_hba.conf | tail -n 8
> >
> > # "local" is for Unix domain socket connections only
> > local all all trust
> > # IPv4 local connections:
> > host all all 127.0.0.1/32 <http://127.0.0.1/32> trust
> > host all all 192.168.0.0/16 <http://192.168.0.0/16> md5
>                               ^^^^^^^^^^^^^^^^^^^^^^
>                               wrong syntax
>
>
> >
> > When I try to connect from the host using pgaminIII for windows, I get
> the
> > following error:
> >
> > "Server not listening"
>
> 1. wrong syntax in pg_hba.conf
> 2. check, if the server ist running (telnet server 5432, it should
>    connect for a few seconds)
>
> My guess: because the wrong syntax the server is not running.
>
>
> HTH, Andreas
> --
> Andreas Kretschmer    (Kontakt: siehe Header)
> Heynitz:  035242/47212,      D1: 0160/7141639
> GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
>  ===    Schollglas Unternehmensgruppe    ===
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

Re: connecting to linux server from windows xp

From
Andreas Kretschmer
Date:
Sebastian Scarano <opensas@gmail.com> schrieb:
> telnet tux 5432 but it couldn't connect
>
> So I tried with telnet 192.168.103.1 5432 and it did connected for a
> few seconds.

Wrong DNS.

Please, no TOFU. Read the english version http://learn.to/quote.


HTH, Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°

Re: connecting to linux server from windows xp

From
Sebastian Scarano
Date:
> > So I tried with telnet 192.168.103.1 5432 and it did connected for a
> > few seconds.
>
> Wrong DNS.

What do you mean with "Wrong DNS" ? I don't have a DNS running (at
least, that's what I though, that's why I had to manually edit the
hosts file in both, the xp guest and the gentoo host. I think I don't
quite get what you mean...

> Please, no TOFU. Read the english version http://learn.to/quote.

Oops!!

Saludos

Sas

Re: connecting to linux server from windows xp

From
"A. Kretschmer"
Date:
am  15.11.2005, um  4:37:03 -0300 mailte Sebastian Scarano folgendes:
> > > So I tried with telnet 192.168.103.1 5432 and it did connected for a
> > > few seconds.
> >
> > Wrong DNS.
>
> What do you mean with "Wrong DNS" ? I don't have a DNS running (at

My guess: 'ping tux' != 'ping 192.168.103.1'.


Check your /etc/hosts and /etc/host.conf.



HTH, Andreas
--
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47212,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    ===

Re: connecting to linux server from windows xp

From
Sebastian Scarano
Date:
On 11/15/05, A. Kretschmer <andreas.kretschmer@schollglas.com> wrote:
> Check your /etc/hosts and /etc/host.conf.

Your were right (Let's face it, I'm an idiot)

Thank you very much for your help, Andreas

Community support like this is what makes open-source so great  :-)))

Saludos

Sas

Re: connecting to linux server from windows xp

From
"A. Kretschmer"
Date:
am  15.11.2005, um 12:37:08 -0300 mailte Sebastian Scarano folgendes:
> On 11/15/05, A. Kretschmer <andreas.kretschmer@schollglas.com> wrote:
> > Check your /etc/hosts and /etc/host.conf.
>
> Community support like this is what makes open-source so great  :-)))

No problem. I'm using OpenSource - Software and I want give back my
knowledge to the community.
PostgreSQL is a very great project! And, if i read question in this
list, i can do any things:

- i read the question and think about, and so i can learn more.
- i give answers, and so i can learn more.
- i read the answers from other people, and so i can learn more.
- i read and write in english, this is not my natural language, and so,
  you know, i can learn more.


Okay, i'm honest, i do it _only_ for me ;-)



Andreas
--
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47212,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    ===