Skip to content
This repository has been archived by the owner on Jan 10, 2019. It is now read-only.
Bram edited this page Feb 3, 2015 · 5 revisions

Environment setup

The installed components need to be configured correctly. The following sections outline the configuration of these components (done on a default Ubuntu 14.04 environment).

### PostGRES The PostGRES database is used for, amongst others, storing user names, passwords and API keys used in the “My Europeana” section of the application. For this, PostGRES requires a user and database to be created (the tables are created by Hibernate when the application is first run). This is easiest done by logging in as the postgres user that is created as part of the PostGRES installation:
sudo su postgres

Run the psql command for a psql shell:

psql

then run the following commands on the psql prompt:

CREATE USER europeana WITH PASSWORD 'password';
CREATE DATABASE europeana OWNER europeana;

To check the database was created correctly, run the following commands in the psql shell:

\du
\list
\q

Exit as postgres user.

For the application to be able to connect to the PostGRES database using password authentication, the PostGRES configuration file (/etc/postgresql/9.3/main/pg_hba.conf) has to be adjusted. Replace the following line

local all all peer

with this:

local all all md5
### Mongo The Mongo database is used to store the metadata of the records (in ESE/EDM format), as well as vocabulary and the API logs. This requires three databases: europeana, vocabulary, apilog. These will be created if they don't exist? ### Tomcat Tomcat is used as web server and servlet container for the application code to run in. The currently used version is 7.0.55, which isn’t available as a readily installable package and thus must be downloaded and unzipped from http://tomcat.apache.org/download-70.cgi:
wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.55/bin/apache-tomcat-7.0.55.tar.gz
tar -xvvf apache-tomcat-7.0.55.tar.gz

A number of Tomcat configuration options need to be set. These can be provided as environment variables (using export in the same shell from which the Tomcat child process will be started), or added to the Tomcat configuration files. Both are shown below:

Export Tomcat configuration as environment variables:

export JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx2048m -XX:MaxPermSize=256m -XX:-UseSplitVerifier"
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
export EUROPEANA_PROPERTIES=/data/portal2/etc/europeana.properties

Note: The first option is to provide backward compatibility between the Java6 compiled code and Java7 runtime environment; this is to be removed in future versions. The europeana.properties file is described below. Its location may vary depending on the setup.

To prevent having to export the variables every time the server is restarted, the above lines can also be added to the startup.sh file located in ./apache-tomcat-7.0.55/bin/

For a production environment, the following additional configuration is recommended (note that </PATH/TO/> needs to be set as a valid path.

export CATALINA_OPTS="$CATALINA_OPTS -Xms4096m -Xmx4096m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:MaxPermSize=1024M -XX:HeapDumpPath=</PATH/TO/DIR/> -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=</PATH/TO/DIR/>hs_err_pid%p.log"

Start the server to see if it works:

./apache-tomcat-7.0.55/bin/startup.sh

Visit http://localhost:8080/ in a browder and the message “It works!” should be visible.