yum install \ postgresql-server \ postgresql-contrib
postgresql-setup initdb
systemctl enable postgresql systemctl start postgresql
sudo -u postgres psql postgres
\password postgres
postgres=# SHOW hba_file; /var/lib/pgsql/data/pg_hba.conf postgres=# SHOW config_file; /var/lib/pgsql/data/postgresql.conf
vi /var/lib/pgsql/data/pg_hba.conf
host all all 127.0.0.1/32 md5
psql -h 127.0.0.1 -U postgres
$ # make it last after reboot $ firewall-cmd --permanent --add-port=5432/tcp $ # change runtime configuration $ firewall-cmd --add-port=5432/tcp
$ semanage fcontext -a -t postgresql_db_t "/my/new/location(/.*)?" $ semanage port -a -t postgresql_port_t -p tcp 5433
sudo nano /etc/postgresql/9.3/main/pg_hba.conf
# "local" is for Unix domain socket connections only
#local all all peer
local all all ident
# IPv4 local connections:
host all all 127.0.0.1/32 md5
host all all 0.0.0.0/0 md5
hostssl all all 0.0.0.0/0 md5
# IPv6 local connections:
host all all ::1/128 md5
sudo nano /etc/postgresql/9.3/main/postgresql.conf
#listen_addresses = 'localhost' # what IP address(es) to listen on;
listen_addresses = '*' # what IP address(es) to listen on;
(you)@lab:~$ psql -h (domain) (domain) postgres
Books: