Installing PostgreSQL 8.4 on Ubuntu 11.04

I am working on getting evergreen-ils running on a test server for later use.

The Evergreen Project develops an open source ILS (integrated library system) used by approximately 800 libraries.  The software, also called Evergreen, is used by libraries to provide their public catalog interface as well as to manage back-of-house operations such as circulation (checkouts and checkins), acquisition of library materials, and (particularly in the case of Evergreen) sharing resources among groups of libraries.

The Evergreen Project was initiated by the Georgia Public Library System in 2006 to serve their need for a scalable catalog shared by (as of now) approximately 250 public libraries in the state of Georgia.  After Evergreen was released, it has since been adopted by a number of library consortia in the US and Canada as well as various individual libraries, and has started being adopted by libraries outside of North America.

http://open-ils.org/about.php

To get Evergreen Running, I have to do a lot of work on my server.  Since I am taking notes as I go, here is the transcript of those notes.  Where I am using passwords, I will instead use the convention of <secret>, so instead of saying “My password is T^T87uugf7h,” I will say “My password is <secret>.”  Things behind a “#” sign are comments – either comments in the files themselves or notes to my readers

The first thing I had to do is set up postgreSQL.  I had it set up a while ago, but I couldn’t remember any of the configurations I had done or the passwords or the users, so it seemed like the best solution was to completely remove it and start again.

——————-

######################
# Configure PostgreSQL
######################
With help from:

http://socrateos.blogspot.com/2011/07/installing-postgresql-90-on-ubuntu-1104.html

Completely remove Postgresql

Install postgresql8.4
Postgresql-client
Postgresql-contrib

==============
wolf@tangle-rock:~$ psql -V
psql (PostgreSQL) 8.4.8
contains support for command-line editing

wolf@tangle-rock:~$ finger postgresql
Login: postgres                   Name: PostgreSQL administrator
Directory: /var/lib/postgresql          Shell: /bin/bash
Never logged in.
No mail.
No Plan.

wolf@tangle-rock:~$ su postgres
Password:
su: Authentication failure
wolf@tangle-rock:~$ sudo passwd postgres
Enter new UNIX password:  <secret>
Retype new UNIX password:
passwd: password updated successfully

postgres@tangle-rock:/home/wolf$ psql
psql (8.4.8)
Type “help” for help.

postgres=# select version();
# opens a less-like interface… (q to exit)

version
——————————————————————————————————————
PostgreSQL 8.4.8 on i686-pc-linux-gnu, compiled by GCC gcc-4.5.real (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2, 32-bit
(1 row)

postgres=# alter user postgres with password ‘<secret>’;
ALTER ROLE
postgres=# \q   # quit psql
postgres@tangle-rock:/home/wolf$ exit
exit
wolf@tangle-rock:~$

6.Configure PostgreSQL Server
wolf@tangle-rock:~$ cd /etc/postgresql/8.4/main/
wolf@tangle-rock:/etc/postgresql/8.4/main$ ls -al
total 48
drwxr-xr-x 2 postgres postgres  4096 2010-12-01 17:59 .
drwxr-xr-x 3 postgres postgres  4096 2010-12-01 17:59 ..
-rw-r–r– 1 postgres postgres   316 2010-12-01 17:59 environment
-rw-r–r– 1 postgres postgres   143 2010-12-01 17:59 pg_ctl.conf
-rw-r—– 1 postgres postgres  3822 2010-12-01 17:59 pg_hba.conf
-rw-r—– 1 postgres postgres  1631 2010-12-01 17:59 pg_ident.conf
-rw-r–r– 1 postgres postgres 16975 2010-12-01 17:59 postgresql.conf
-rw-r–r– 1 postgres postgres   378 2010-12-01 17:59 start.conf

wolf@tangle-rock:/etc/postgresql/8.4/main$ su postgres
Password: <secret>
postgres@tangle-rock:/etc/postgresql/8.4/main$ mkdir bak20110713
postgres@tangle-rock:/etc/postgresql/8.4/main$ cp *.conf bak20110713/
postgres@tangle-rock:/etc/postgresql/8.4/main$ ls bak20110713/
pg_ctl.conf  pg_hba.conf  pg_ident.conf  postgresql.conf  start.conf

postgres@tangle-rock:/etc/postgresql/8.4/main$ vi pg_hba.conf
=============
# IPv4 local connections:
#host    all         all         127.0.0.1/32          md5
host    all         all         127.0.0.1/32          trust
# IPv6 local connections:
:wq

postgres@tangle-rock:/etc/postgresql/8.4/main$ vi postgresql.conf
=============
# Enabled 20110714

#——————————————————————————
# ERROR REPORTING AND LOGGING
#——————————————————————————
log_destination = ‘stderr’

logging_collector = on

log_directory = ‘pg_log’
log_filename = ‘postgresql-%Y-%m-%d_%H%M%S.log’

log_truncate_on_rotation = off

log_rotation_age = 1d

log_rotation_size = 10MB

postgres@tangle-rock:/etc/postgresql/8.4/main$ mkdir pg_log
postgres@tangle-rock:/etc/postgresql/8.4/main$ # Made log directory

3 comments

  • You rawwk! This saved me some time. I’m in the process of switching from MySQL to PostgreSQL

  • Hi Zamphatta!
    Glad I can help.
    I am upgrading Ubuntu 10.04LTS servers from Postgresql-8.4 to Postgresql-9.0. This is a bit more complicated when there are already databases with real data sitting on the 8.4 installations. You cannot just add the backport repository that gets 9.0. That breaks the existing databases. As soon as I have that sorted out (with lots of help from Dan Scott at http://coffeecode.net) I will post it as well.

  • Thanks for the post! Saved me quite some time.

Leave a Reply