User Tools

Site Tools


postgresql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

postgresql [2019/01/25 12:48]
pi created
postgresql [2019/01/25 13:35] (current)
pi
Line 44: Line 44:
 To grant permissions to the ''​pi''​ user on the ''​pidb''​ we created in the previous step, connect to the PostgreSQL shell, and run the following query: To grant permissions to the ''​pi''​ user on the ''​pidb''​ we created in the previous step, connect to the PostgreSQL shell, and run the following query:
 <​code>​sudo -u postgres psql <​code>​sudo -u postgres psql
-grant all privileges on database pidb to pi;</​code>​+grant all privileges on database pidb to pi; 
 +\q</​code>​ 
 + 
 +==== 1.4 --- PostgreSQL config file paths ==== 
 +<​code>/​etc/​postgresql/​9.6/​main/​postgresql.conf</​code>​ 
 +<​code>/​etc/​postgresql/​9.6/​main/​pg_hba.conf</​code>​ 
 + 
 +==== 2.0 --- Install phppgAdmin ==== 
 + 
 +<​code>​sudo apt-get install phppgadmin php7.2-pgsql</​code>​ 
 +Note: for buster release you may have to install like this: ''​sudo apt-get install -t buster phppgadmin php7.2-pgsql''​ 
 + 
 +==== 2.1 --- Configure Apache ==== 
 + 
 +Edit the ''/​etc/​apache2/​conf-available/​phppgadmin.conf''​ configuration file by typing: 
 +<​code>​sudo nano /​etc/​apache2/​conf-available/​phppgadmin.conf</​code>​ 
 +Comment out the line ''#​Require local''​ and add below the line ''​Require all granted''​ so that you can access from your browser: 
 +<​code>​[...] 
 +# Only allow connections from localhost:​ 
 +#Require local 
 +Require all granted 
 +[...]</​code>​ 
 + 
 +==== 2.2 --- Configure phppgAdmin ==== 
 +Edit the ''/​etc/​phppgadmin/​config.inc.php''​ configuration file by typing: 
 +<​code>​sudo nano /​etc/​phppgadmin/​config.inc.php</​code>​ 
 +Find the line '​$conf['​extra_login_security'​] = true;' and change the value to '​false'​ so you can login to phpPgAdmin with user postgres: 
 +<​code>​[...] 
 +$conf['​extra_login_security'​] = false; 
 +[...]</​code>​ 
 + 
 +Finaly we enable the configurations and restart services: 
 +<​code>​sudo a2enconf phppgadmin.conf 
 +sudo systemctl restart postgresql 
 +sudo systemctl restart apache2</​code>​ 
 + 
 +You can now access phpPgAdmin with your browser ''​https://​rpi.tiger-park.com/​phppgadmin''​.
  
  
postgresql.txt · Last modified: 2019/01/25 13:35 by pi