Skip to content

Beginner's Guide to Installing Postgres

Rainer Simon edited this page Mar 2, 2017 · 1 revision

Here are the steps I took for setting up Postgres with Recogito on our Pelagios Linux server.

Step 1. Install PostgreSQL via the package manager (see [here] (http://www.postgresql.org/download/linux/ubuntu/)). In my case (Ubuntu 12.04 LTS), the default package was Postgres version 9.1. I installed version 9.2 instead though, through ppa:pitti/postgresql.

Step 2. After the database server is running, create a user, a database (e.g. both named 'recogito') and set the new user as the database owner:

sudo -u postgres psql

...

CREATE USER recogito ;
ALTER USER recogito WITH ENCRYPTED PASSWORD 'your_password' ;
CREATE DATABASE recogito ;
ALTER DATABASE recogito OWNER TO recogito ;

Step 3. After configuring the user's password, edit the file /etc/postgresql/9.2/main/pg_hba.conf to use MD5 authentication. Add the line:

local   all             recogito                                md5

Step 4. Restart the database server (sudo service postgresql restart) for the changes to take effect and test the login:

psql recogito recogito

Step 5. Set up Recogito to access your database. In the file conf/application.conf configure the database connection like so:

# Postgres configuration example
db.default.driver="org.postgresql.Driver"
db.default.url="jdbc:postgresql://localhost/recogito"
db.default.user="recogito"
db.default.password="your_password"