Install yum
Yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-1.noarch.rpm
Yum install postgresql94-server postgresql94-contrib
Set startup
Systemctl enable postgresql-9.4.service
Systemctl start postgresql-9.4.service
Initialize database
/Usr/pgsql-9.4/bin/postgresql94-setup initdb
Enable remote access
/Var/lib/pgsql/9.4/data/postgresql. conf
Listen_addresses = '*'
/Var/lib/pgsql/9.4/data/pg_assist.conf
# IPv4 local connections:
Host all 127.0.0.1/32 trust
Host all 192.168.117.1/32 trust
# IPv6 local connections:
Host all: 1/128 trust
Change user password
Su IPVS
Psql-U postgres
Alter user login s with password '0stgres'
\ Q
Firewall
Create a file/usr/lib/firewalld/services/ipvs94.xml
<? Xml version = "1.0" encoding = "UTF-8"?>
<Service>
<Short> IPVs 9.4 Database service </short>
<Description> S </description>
<Portprotocol = "tcp" port = "5432"/>
</Service>
Modify firewall settings
Firewall-cmd -- permanent -- add-service = ipvs94
Firewall-cmd -- reload
Enable remote access
Vi/var/lib/pgsql/9.5/data/postgresql. conf
Modify # listen_addresses = 'localhost' to listen_addresses = '*'
Of course, '*' can also be changed to any server IP address you want to open.
Configure phppgadmin
Edit vi/var/www/html/phpPgAdmin/conf/config. inc. php
Find $ conf ['servers'] [0] ['host'] and change it to $ conf ['servers'] [0] ['host'] = '2017. 0.0.1 ';
Find $ conf ['extra _ login_security '] and change it to $ conf ['extra _ login_security'] = false; // phppgadmin cannot log on to postgre by default.
Restart PostgreSQL data service
Systemctl restart postgresql-9.5.service