PostgreSQLPrequisites
If you do not have this prerequisite, the easiest way on Windows is to use Cygwinas it has a binary package for PostgreSQL already built. If you are on Unix, you get to build from source. StepsThese steps take you from creating the intial database file repository to running the server. They should take approximately 15 minutes to complete. Start the serverCreate a new database file repository named irv with the initdb command: initdb irv Start PostgreSQL against this new repository: postmaster -D irv -i The -D tells PostgreSQL to use the irv file repository and -i tells PostgreSQL to listen for JDBC connections. This command should not return as it the actual PostgreSQL process. If you have problems or stop following these instructions, you may use CTRL-C to stop the PostgreSQL process. Create the IRV databaseOnce the server is running against the new irv file repository, an irv database needs to be created within this repository. createdb irv Install PL/pgSQLOnce the database is created, you must install PL/pgSQL for stored procedures to work. createlang -d irv plpgsql Create the IRV usersThe IRV system uses two users to access the database. These need to be created manually. First, start a PostgreSQL terminal session: psql irv Now execute the following commands, using your own password is you desire, keeping the single ticks around the passwords: CREATE USER irv_admin WITH PASSWORD 'polaris'; CREATE USER irv_user WITH PASSWORD 'polaris'; Update securityThe default security on PostgreSQL is rather lax. This step modifies this and also lets the irv_admin/irv_user users in if they are from the CMU network. Within the irv file repository created in the first step, edit the pg_hba.conf file. Change the two existing lines: local all all trust host all all 127.0.0.1 255.255.255.255 trust To: local all irv_admin md5 host all irv_admin 127.0.0.1 255.255.255.255 md5 This will ensure local access is restricted to users who know the irv_admin username and password. Next, add the following three lines: host all irv_admin 128.2.0.0 255.255.0.0 md5 host irv irv_user 127.0.0.1 255.255.255.255 md5 host irv irv_user 128.2.0.0 255.255.0.0 md5 This will allow irv_admin and irv_user to connect both locally and from anywhere in the CMU network. Once these changes are made, restart PostgreSQL (use CTRL-C to kill the current process and re-run the postmaster command). Create the tables and permissionsThis step is automated by the IRV BuildSystem. Make to check the Configurationto ensure your build environment is talking to the correct database. Once you have verified this, from the IRV root directory, run: ant db.create ConclusionThat's it, the database is now configured to allow irv_admin/irv_user to connect to it and has the correct table structure for the IRV application to run against it. |