Web interface to PostgreSQL: phpPgAdmin


by ross at 17:54:53 on March 20, 2014

Prepare Postgres

Make sure password is needed to connect to the database. Edit /usr/local/pgsql/data/pg_hba.conf:

# TYPE  DATABASE        USER            CIDR-ADDRESS            METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     password
# IPv4 local connections:
host    all             all               password
# IPv6 local connections:
host    all             all             ::1/128                 password

host    all             all            md5

Restart Postgres:

# service postgresql restart


# cd /usr/ports/databases/phppgadmin
# make install clean
# rehash

Create /usr/local/etc/apache22/Includes/phppgadmin.conf:

    Alias /postgres "/usr/local/www/phpPgAdmin/"

    <Directory "/usr/local/www/phpPgAdmin/">
        Options None
        AllowOverride None
        Order Deny,Allow
        Deny from all
        Allow from .lan

Replace .lan with your LAN zone.

Edit /usr/local/www/phpPgAdmin/conf/config.inc.php:

 $conf['extra_login_security'] = false;

You need the line above to login as pgsql.

Restart apache

# service apache22 restart

Navigate to http://yourserver/postgres/ and login as pgsql.