Setting up PostgreSQL

Setting up PostgreSQL 8.x and phpPgAdmin on FreeBSD 7.1
Lars Sommer, lasg@lasg.dk, 2009-01-18
DISCLAIMER: This is a personal note made for personal usage. It might not be easy usable nor explaining.

PostgreSQL:

Install the port or package:
databases/postgresql-8.3

If PostgreSQL are supposed to run inside a jail, this must be set in the
master host (the box outside, containing the jails):
echo “security.jail.sysvipc_allowed=1″ >> /etc/sysctl.conf

Insert an entry to rc.conf:
echo ‘postgresql_enable=”YES”‘ >> /etc/rc.conf

Then PostgreSQL can be initialized and started:
/usr/local/etc/rc.d/postgresql initdb
/usr/local/etc/rc.d/postgresql start

An administrative user should be created:
su pgsql -c ‘createuser -s -P lasg’

Add to /usr/local/pgsql/data/postgresql.conf
listen_addresses = ‘localhost,192.168.1.52′

Add to /usr/local/pgsql/data/pg_hba.conf
host all all 192.168.1.52/32 trust

phpPgAdmin:

Install the port or package:

databases/phppgadmin

Add to apaches httpd.conf:

Alias /phppgadmin/ “/usr/local/www/phpPgAdmin/”

Options none
AllowOverride Limit
Allow from all

Restart Apache:
/usr/local/etc/rc.d/apache22 restart

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>