su root
2:Download Postgresql Yum repo to Centos
[root@localhost ~]# wget http://yum.pgrpms.org/9.2/redhat/rhel-6.3-x86_64/pgdg-centos92-9.2-6.noarch.rpm
3. Install Repo into our Server
[root@localhost ~]# rpm -ivh pgdg-centos92-9.2-6.noarch.rpm
4:Exclude postgresql in CentOS-Base.repo
vi /etc/yum.repos.d/CentOS-Base.repo
[root@localhost yum.repos.d]# yum install postgresql92 postgresql92-devel postgresql92-server postgresql92-libs postgresql92-contrib -y
6. Start Postgresql and
check postgresql process
[root@localhost yum.repos.d]# service postgresql-9.2 initdb
[root@localhost yum.repos.d]# /etc/init.d/postgresql-9.2 start
[root@localhost yum.repos.d]# netstat -nutlap | grep post
7.Open
/var/lib/pgsql/9.2/data/postgresql.conf file, and add/uncomment/modify following:
listen_addresses = '*'
port = 5432
8:Edit
/etc/sysconfig/iptables file
[root@localhost yum.repos.d]# vi /etc/sysconfig/iptables
Add following line before -A
INPUT -j REJECT… -A INPUT -m state --state NEW -m tcp -p tcp
--dport 5432 -j ACCEPT
9:Set PostgreSQL
Permissions
Modify PostgreSQL
/var/lib/pgsql/9.2/data/pg_hba.conf (host-based authentication)
file: host all phonelwc 192.168.1.1/32 md5
10:restart postgres server
[root@localhost
yum.repos.d]#service postgresql-9.2restar
11:Linking: