OpenACS on Windows: Installing PostgreSQL

Overview
These directions describe how to install and configure PostgreSQL for use with OpenACS on Windows.  PostgreSQL doesn't natively run on Windows (yet), so we are going to install it as part of the Cygwin environment.  We are going to set the database up to run as a service, which means it can be running when nobody is logged in to the machine.

THINGS THAT SHOULD BE CLARIFIED ARE IN ALL CAPS.
This document last modified: 12 March 2003

 

Installing PostgreSQL / Cygwin

I SHOULD UPDATE THE INSTRUCTIONS BELOW TO REFLECT THE CREATION AND USE OF A POSTGRES ACCOUNT AS IN JASON TISHLER'S README.

Before beginning, make sure that you are a local machine administator. This is necessary because you will be installing services, etc.

  1. Install the latest verion (1.3.19+) of Cygwin
  2. Install Charles Wilson's Cygwin IPC package. According to the webpage, this work is going to be absorbed by the forthcoming "Cygwin Daemon", a new native component of the Cygwin distribution.  But for now, you'll still need this package.
  3. Build and Initialize PostgreSQL
  4. Install PostgreSQL as a service that depends on ipc-daemon. If you run into problems starting PostgreSQL as a service, remove it with cygrunsrv -R postmaster and add --stderr logfile to the cygrunsrv command below. Run the following commands from a Win2k cmd prompt:
      cygrunsrv -I postmaster -p /usr/bin/postmaster -a "-D /usr/share/postgresql/data -i" -y ipc-daemon -s INT -o
    net start postmaster

  5. This step is optional, but I highly recommend it. Install pgAdmin II, a Windows-based design and management system for PostgreSQL that works over ODBC.

  6. Create a file called recreate-acs-db.txt in your Cygwin home dir. (Probably C:\cygwin\home\Administrator - run cd; pwd to confirm.)  Copy the following script into the file.  When run, it drops the "acs" database and recreates it.  Use a password you will remember!  To run the script in your Cygwin bash shell, make sure PostgreSQL is running, then execute source recreate-acs-db.txt.
      droplang -h localhost -U acs plpgsql acs
    dropdb -h localhost -U acs -W -e acs
    dropuser -h localhost -e acs
    createuser -d -a -P -h localhost acs
    createdb -h localhost -U acs -W -e acs
    createlang -h localhost -U acs plpgsql acs

References


Copyright © 2001-2003 MediaLabEurope Limited. All rights reserved.