Skip to content

Instantly share code, notes, and snippets.

@nimeshpahadi
Last active March 10, 2017 12:44
Show Gist options
  • Save nimeshpahadi/40dec96552ea3ecce2d11f2ff09b7842 to your computer and use it in GitHub Desktop.
Save nimeshpahadi/40dec96552ea3ecce2d11f2ff09b7842 to your computer and use it in GitHub Desktop.
install & setup
# Add PostgreSQL Apt Repository
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | sudo apt-key add -
# Install PostgreSQL
sudo apt-get update
sudo apt-get -y install postgresql postgresql-contrib phppgadmin
# Configure PostgreSQL user
sudo su - postgres
psql
# change the password for postgres role
\password postgres
# ENTER YOUR PASSWORD (i keep "postgres" same as user for simplicity)
# enter "\conninfo" to check login info
\conninfo
# enter "\q" to leave the psql command line
\q
# Run the command "exit" to leave the postgres user and become root again
exit
# Configure Apache2
# Edit the file /etc/apache2/conf-available/phppgadmin.conf
sudo nano /etc/apache2/conf-available/phppgadmin.conf
# Comment the line "Require local" with "#"
#Require local
# add the line "Allow From all" below it
Allow From all
# Configure phpPgAdmin
# Edit the file /etc/phppgadmin/config.inc.php
sudo nano /etc/phppgadmin/config.inc.php
# search for line
$conf['extra_login_security'] = true;
# change to
$conf['extra_login_security'] = false;
# Restart PostgreSQL and Apache2
sudo systemctl restart postgresql
sudo systemctl restart apache2
# access phpPgAdmin from browser http://yourip/phppgadmin/
# login with user "postgres" & your password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment