Showing posts with label postgresql. Show all posts
Showing posts with label postgresql. Show all posts

Wednesday, November 16, 2011

enable remote access PostgreSQL in Windows

Bismillah...

So, in my current office I am not using Ubuntu more...
I have to use Windows server 2008 as my application server.

Just same when I use Ubuntu...  I should learn from zera how to maintain a server... haha
okay... back to the topic...

I installer PostgreSQL 8.4 on server
and want that database can be accessed remotely...

In ubuntu the steps is easy like my post before enable-remote-access-postgresql
In windows the steps are same, which are
- edit pg_hba.conf
- edit postgresql.conf
- restart server

OKay... it easy but I always failed...
Why?
Because I was totally wrong placing file pg_hba.conf and postgresql.conf
I placed them on root of postgre folder
because some blog said that...

then, after read this blog http://developer.postgresql.org/pgdocs/postgres/auth-pg-hba-conf.html
I just knew that it should be placed on data dictionary...

It just I place data dictionary in "D" space not "C"
so, I didnt realize that folder...

pfiuuhh....

Ohya don't forget to add New Line in last line of file pg_hba.conf

Hope this help...

Monday, June 28, 2010

install 2 versions postgre (8.2 dan 8.3)

Ahhh saya lagi malas berbahasa Inggriss....
jadi awalnya ada kebutuhan utk install postgre 8.3 karena aplikasi yg mau kuinstall
mewajibkan minimum req postgre 8.3
Sedangkan di laptopku dengan OS Ubuntu 9.04 - the Jaunty Jackalope sudah terinstall postgre-8.2 dan gak mungkin diunsintal karena ada aplikasi yang sudah ditetapkan pakai 8.2 dan malas sekali aku upgrade aplikasi tsb... hehe..
So, akhirnya tanya ke sana ke mari... (thanks to mas toni sutomo and pak reza primardiansyah yg dah kasih solusi)

so, ternyata gampang ajah tinggal instal lagi aja version 8.3 nya spt biasa dengan apt...
# apt-get install postgresql-8.3

kalo 8.2 dulu installnya download paket2nya secara manual, karena paket di ubuntu 9.04 secara default adalah 8.3..

terus bedain deh portnya..
karena yg pertama kali diinstal adalah 8.2 dengan default port 5432, maka yg harus diubah portnya adalah yg version 8.3
yaitu dengan edit file: /etc/postgresql/8.3/main/postgresql.conf
edit bagian ini:
port = 5432 # (change requires restart)
ubah aja jadi 5433
terus restart dah...

terus utk pakai psqlnya...
defaultnya kalo jalankan psql akan masuk ke sever 8.2 dengan port 5432
utk menggunakan psql utk versi 8.3
jalankan:
/usr/lib/postgresql/8.3/bin/psql (bikin aja symlink utk langsung akses ini)

nah ternyata biarpun sudah pakai psql versi 8.3 dia akan tetap akses server postgre versi 8.2
oleh karena itu tampbahkan paramter portnya...
/usr/lib/postgresql/8.3/bin/psql -p 5433
baru deh bisa akses server 8.3

as simple as that..........
^o^

Tuesday, October 14, 2008

enable remote access PostgreSQL

In default, for security reason, postgreSQL doesn't allow to be accessed remoted.
But, we can configure it so it can be accessed remotely.

Below is the step to do that with follow the steps I done with postgreSQL8.2 in Ubuntu OS
1. Login as postgres
# su - postgres
2. edit configuration file (pg_hba.conf)
# vi /etc/postgresql/8.2/main/pg_hba.conf
append below line to that file:
host all all 192.168.1.0/24 trust

where 192.168.1.0 is IP configuration in your network
3. edit configuration file: postgresql.conf to allow TCP/IP socket
# vi /etc/postgresql/8.2/main/postgresql.conf
find line:
listen_addresses='localhost'
and change into
:
listen_addresses='*'


4. restart postgreSQl with:
# /etc/init.d/postgresql-8.2 restart

Finisih