• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomepcDuinoLinux ApplicationsHow to install phpPgAdmin on pcDuino Ubuntu
Previous Next

How to install phpPgAdmin on pcDuino Ubuntu

Posted by: Yang , July 8, 2014

What is phpPgAdmin?

phpPgAdmin is a web-based administration tool for PostgreSQL. It is perfect for PostgreSQL DBAs, newbies, and hosting services.

Download latest version: 5.1 (14th April 2013)

Features

  1. Administer multiple servers
  2. Support for PostgreSQL 8.4.x, 9.0.x, 9.1.x, 9.2.x
  3. Manage all aspects of:
    • Users & groups
    • Databases
    • Schemas
    • Tables, indexes, constraints, triggers, rules & privileges
    • Views, sequences & functions
    • Advanced objects
    • Reports
  4. Easy data manipulation:
    • Browse tables, views & reports
    • Execute arbitrary SQL
    • Select, insert, update and delete
  5. Dump table data in a variety of formats: SQL, COPY, XML, XHTML, CSV, Tabbed, pg_dump
  6. Import SQL scripts, COPY data, XML, CSV and Tabbed
  7. Supports the Slony master-slave replication engine
  8. Excellent language support:
    • Available in 27 languages
    • No encoding conflicts. Edit Russian data using a Japanese interface!
  9. Easy to install and configure

Step 1: Install PHP 5

$ sudo apt-get install php5

Step 2: Install Apache2

$ sudo apt-get install apache2

Step 3: Install PostgreSQL

$ sudo apt-get install postgresql-9.3

Step 4: Install phpPgAdmin

$ sudo apt-get install phppgadmin

Step 5: Configure

 1. Edit phppgadmin file

Comment out (add # at beginning of line) “allow from 127.0.0.0/255.0.0.0 ::1/128” and remove # from the line below it, “allow from all”.  save file and exit.

$ sudo nano /etc/apache2/conf.d/phppgadmin

2014-07-09-025838_1280x696_scrot

2. Edit pg_hba.conf

PostgreSQL, in  pg_hba.conf file by default, runs in md5 mode. That means  you might need to enter a password to start PostgreSQL. Get around this by using a .pgpass file – explained in the PostgreSQL documentation.  If runs in trust mode, that it doesn’t ask for passwords for local connections. , and change the login type to nothing. (If it’s still login fail, edit pg_hba.conf  agian, delet “trust”, type ” trust” agian. and then save file and exit. reload postgresql service .)

$ sudo nano /etc/postgresql/9.3/main/pg_hba.conf

2014-07-09-015530_1280x696_scrot

3. Edit postgresql.conf

$ sudo nano /etc/postgresql/9.3/main/postgresql.conf

edit your postgresql.conf file and change this line:

#listen_addresses = 'localhost'

to:

listen_addresses = '*'

2014-07-09-031024_1280x696_scrot

 

4. Edit phppgadmin config.inc.php

$ sudo nano /etc/phppgadmin/config.inc.php

On the phpPgAdmin side, read and setup accordingly your phpPgAdmin configuration file (“conf/config.inc.php”). Pay attention to the parameters $conf[‘servers’][0][‘host’] and $conf[‘extra_login_security’].

If you really want to use the “postgres” role, make sure you set it up a password and $conf[‘extra_login_security’] is false.

2014-07-09-015854_1280x696_scrot

5. Create symlink

There should be symlink /var/www/html/ phppgadmin which would point to /usr/share/phppgadmin
If the symlink does not exist then it can be created by issuing the following command

$ cd /var/www/html
$ sudo ln -s /usr/share/phppgadmin phppgadmin
$ ls -l

6. restart/reload  apache2  postgresql service

$ /etc/init.d/apache2 reload
$ /etc/init.d/postgresql reload

[OR]
$ /etc/init.d/apache2 restart
$ /etc/init.d/postgresql restart

7. Go to phpPgAdmin

Now open the url “localhost/phppgadmin” in your browser

Click ” X PostgreSQL” under the ” Server ”

Type username:  postgres, click “Login” button. (no password setup before 4. Edit phppgadmin config.inc.php)

2014-07-09-020508_1050x676_scrot 2014-07-09-020517_1280x696_scrot 2014-07-09-032608_1280x696_scrot 2014-07-09-032442_1280x696_scrot 2010-01-01-022319_1280x696_scrot

Tags: Linux Applications

Share!
Tweet

Yang

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors