Friday, September 15, 2006

PostgreSQL Over TCP/IP

Configuring a PostgreSQL server to listen for remote connection requests over TCP/IP:

(File locations as according to a Debian Etch setup)

In /etc/postgresql/8.1/main/pg_hba.conf, add:

# Allow connections from, say, 10.207.110.x
host all all 10.207.110.0/24 md5


In /etc/postgresql/8.1/main/postgresql.conf:

listen_addresses = "*" # listen to requests from all IPs


Finally, assuming the PostgreSQL server is listing on port 5432, update /etc/init.d/firewall.sh to contain

$IPT_bin -A INPUT -i eth0 -p tcp --dport 5432 -j ACCEPT

No comments: