Debian Etch - Example PostgreSQL 8.2 setup

From DocMGR

Jump to: navigation, search

[edit] Installing PostgreSQL 8.2 from backports.org

This assumes you don't have any other versions of Postgres already installed. If so you need to be aware of how to change default paths etc, not covered here.

Add backports to sources.list and install postgres

echo "deb http://www.backports.org/debian etch-backports main contrib non-free" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -t etch-backports debian-backports-keyring postgresql

Change to the postgresql user, create a user for apache(it runs as www-data), create db for docmgr owned by www-data

sudo -i -u postgres
createuser -DRS www-data
createdb -e -O www-data docmgr

[edit] Configure docmgr to connect using unix sockets

Change the connection settings in <path>/config/config.php like this

define("DBHOST","''");
define("DBUSER","www-data");
define("DBPASSWORD","''");
define("DBPORT","''");
define("DBNAME","docmgr");

pg_connect uses unix sockets if host is blank. This is the easiest way of using postgres with apache securely in my opinion.

Personal tools