View Single Post
  #2   (View Single Post)  
Old 26th October 2008
Sunnz's Avatar
Sunnz Sunnz is offline
Real Name: I don't have real time
Just a computer user...
 
Join Date: May 2008
Location: See Google Maps
Posts: 101
Default

Ok I guess I am gotta to answer my own question here...

It turns out that PostgreSQL can be accessed via either a Unix socket or TCP/IP connection, the default port is 5432 or something like that, the client and the server uses the default port to begin with.

Anyway, I edited /var/postgresql/data/postgresql.conf and make ListenAddress="*". I don't know why but when ListenAddress="localhost" it doesn't do TCP/IP for some reason... well actually it may, but it is weird...

I've also edited /var/postgresql/data/pg_hba.conf, and put my internal IP for the server it there... it is not 127.0.0.1/32 but like, if my server's internal IP was 10.1.1.1, I had to put 10.1.1.1/32 in to that file in order to 'allow' connections from 10.1.1.1, it is more or less like a firewall rule. I don't know why the PHP script wouldn't just connect to localhost, but that's what I had to do to make it work. The /32 is necessary as well, even for a single address.
__________________
She sells C shells by the seashore.
Reply With Quote