jueves, 7 de noviembre de 2019

24. Vaadin 14. Packaging, deploying, war (5). Installing Postgres on the server

1. Installing Postgres on Ubuntu 18.04


I have followed the steps of Postgres page

1.1  Create the file /etc/apt/sources.list.d/pgdg.list (sudo gedit )and add a line for the repository

1.2 Add this content

deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main

1.3 Import repository signing key, and update package list


wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update

1.4 Install desired packages


#1st install the DB
sudo apt-get install postgresql-12

#2nd install administrator 
sudo apt-get install pgadmin4

1.5 Update password of recently created user postgres


sudo -u postgres psql template1


ALTER USER postgres with encrypted password 'your_password';

1.6 Enable remote connections


Edit the file /etc/postgresql/12/main/postgresql.conf


sudo gedit /etc/postgresql/12/main/postgresql.conf

 add this line


listen_addresses = '*'

Edit the file /etc/postgresql/12/main/pg_hba.conf


sudo gedit /etc/postgresql/12/main/pg_hba.conf

 add this line


host  all  all 0.0.0.0/0 md5

1.7 Restart the server


sudo /etc/init.d/postgresql restart

1.8 Enter in PgAdmin4 on the localhost (not recommended in remote servers) and create a backup user with all privileges


No hay comentarios:

Publicar un comentario