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
-
Administer multiple servers
-
Support for PostgreSQL 8.4.x, 9.0.x, 9.1.x, 9.2.x
-
Manage all aspects of:
-
Users & groups
-
Databases
-
Schemas
-
Tables, indexes, constraints, triggers, rules & privileges
-
Views, sequences & functions
-
Advanced objects
-
Reports
-
-
Easy data manipulation:
-
Browse tables, views & reports
-
Execute arbitrary SQL
-
Select, insert, update and delete
-
-
Dump table data in a variety of formats: SQL, COPY, XML, XHTML, CSV, Tabbed, pg_dump
-
Import SQL scripts, COPY data, XML, CSV and Tabbed
-
Supports the Slony master-slave replication engine
-
Excellent language support:
-
Available in 27 languages
-
No encoding conflicts. Edit Russian data using a Japanese interface!
-
-
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
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
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 = '*'
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.
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)
Leave a Reply
You must be logged in to post a comment.