Web interface to PostgreSQL: phpPgAdmin

Configuration

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             127.0.0.1/32            password
# IPv6 local connections:
host    all             all             ::1/128                 password

host    all             all             192.168.10.0/24         md5

Restart Postgres:

# service postgresql restart

Install

# 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 127.0.0.1 .lan
    </Directory>

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.

 

Comments