Postgresql Installation in CentOS/RHEL servers

# yum install postgresql postgresql-server

Start Postgresql
# chkconfig postgresql on
# service postgresql start

Connect to Postgresql Server
# su – postgres
Connect using psql command line tool:
$ psql -d template1 -U postgres

Open TCP port 5432(Postgresql uses port 5432)
Finally make sure iptables allows remote access to Postgresql database server.
Open /etc/sysconfig/iptables file.
# vi /etc/sysconfig/iptables

Append following line before COMMIT line to open port 5432
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 5432 -j ACCEPT

Save and close the file. Restart the firewall.

# service iptables restart

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s