Installing a new Debian server from scratch

Add the following to your /etc/apt/sources.list

deb http://ftp.uk.debian.org/debian lenny main contrib non-free
deb http://security.debian.org lenny/updates main contrib
deb http://www.backports.org/debian lenny-backports main contrib non-free

apt-get upgrade
apt-get install debian-backports-keyring
apt-get update

Postgresql 8.4 (latest stable)

apt-get -t lenny-backports install postgresql-8.4

configure /etc/postgresql/8.4/main/pg_hba.conf
configure /etc/postgresql/8.4/main/postgresql.conf
/etc/init.d/postgresql-8.4 restart

PHP 5.2.6-1 (+lenny9 with Suhosin-Patch)

apt-get install php5 php5-imagick php5-cli php5-gd php5-mcrypt php5-pgsql php5-xmlrpc

configure /etc/php5/apache2/php.ini
/etc/init.d/apache2 restart

ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
/etc/init.d/apache2 restart

Recommended reading

Design by Jon