Posted by : at

Category : postgresql   ubuntu

Installing Postgreqsl

Step 1:

sudo apt-get -y install postgresql postgresql-contrib phppgadmin

Step 2:

PostgreSQL uses role for user authentication and authorization, it just like Unix-Style permissions. By default, PostgreSQL creates a new user called “postgres” for basic authentication. To use PostgreSQL, you need to login to the “postgres” account, you can do that by typing:

sudo su
su - postgres

Now you can access the PostgreSQL prompt with the command:


And then change the password for postgres role by typing

\password postgres

Then enter \q to leave the psql command line.

Run the command “exit” to leave the postgres user and become root again


Configuring Apache2

In order to user phppgadmin we need to configure Apache 2

cd /etc/apache2/conf-available/
nano phppadmin.conf

curl -i -x post -H ‘Content-Type: application/json’ –data ‘{“something”:”something”}’ http://localhost:3000/api/sujay/?=123