Installing Trac on Ubuntu 8.04 with an existing SVN -Part 2

This blog entry gives step by step instruction to the installation of Trac on Ubuntu 8.04 with an existing SVN repository part 2

Part2: Install PostgreSQL on Ubuntu 8.04

  1. Install postgresql database server/client and some extra utility scripts:
    • sudo apt-get install postgresql postgresql-client postgresql-contrib
  2. Install python2.5 and postgresql binding:
    • sudo apt-get install python-psycopg2
  3. Install pgadmin3 (the GUI application for working with the database):
    • sudo apt-get install pgadmin3
  4. Delete the password for the unix user 'postgres' (this user is created automatically after the installation of postgresql)
    • sudo passwd -d postgres
  5. Set the password for the unix user 'postgres' to 'zoids999'
    • sudo su postgres -c passwd
  6. Create a postgresql user for Trac called 'trac' with password 'whatever you want' (just make sure you remember it) who has priviledge of creating databases:
    • Enter the postgresql shell as the user “postgres”
      • sudo su postgres
      • psql
    • Create a user named 'trac' with the priviledge of creating database
      • postgres=# create user trac with createdb
    • set trac's password to 'whatever you want'
      • postgres=# \password trac
        (enter password at prompt)
  7. Edit the postgresql.conf file so that user can access the databases remotely:
    • sudo vim /etc/posgresql/8.3/main/postgresql.conf
    • Change the line: #listen_address ='localhost' to
      listent_address='*'
    • Change the line: #password_encription =on to
      password_encription=on
  8. Define who can access the server, add the following text to pg_hba.conf file.
    • sudo vim /etc/postgresql/8.3/main/pg_hba.conf
    • Comment out or delete the current contents of the file, then add this text to the bottom of the file:
      • # DO NOT DISABLE!
        # If you change this first entry you will need to make sure that the
        # database
        # super user can access the database using some other method.
        # Noninteractive
        # access to all databases is required during automatic maintenance
        # (autovacuum, daily cronjob, replication, and similar tasks).
        #
        # Database administrative login by UNIX sockets
        local all postgres ident sameuser
        # TYPE DATABASE USER CIDR-ADDRESS METHOD

        # "local" is for Unix domain socket connections only
        local all all md5
        # IPv4 local connections:
        host all all 127.0.0.1/32 md5
        # IPv6 local connections:
        host all all ::1/128 md5

        # Connections for all PCs on the subnet
        #
        # TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
        host all all 74.50.49.9 255.255.255.0 md5

  9. Restart the postgresql server:
    • sudo /etc/init.d/posgresql-8.3 restart