User Tools

Site Tools


howto:molgenis_install

This is an old revision of the document!


Installing Molgenis on Ubuntu

Note that the below procedure would not have been possible without the help of David van Enckevort. The document highlights the installation of the Molgenis web application. If you would like to develop or contribute (code) to the project, you are better off forking the github version.

Requirements

Install Java 8 (my favorite is the Oracle JDK). There are many websites explaining how to do this, but the TL;DR version is:

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer # some annoying licence acceptance terms will pop up
sudo apt-get install oracle-java8-set-default

When you are done java -version and javac -version should yield the Java 8 version and build number. Note that version 8 is a requirement for the molgenis platform.

You will also need to install Tomcat 7. This is straightforward with

sudo apt-get install tomcat7

Molgenis uses MySQL for its backend - so this needs to be installed using the following:

sudo apt-get install mysql-server libmysql-java

During this installation of MySQL you will be prompted for the root password, make sure to use something memorable. Note that libmysql-java installs the JDBC connection driver to MySQL.

Installation Procedure

  1. Tomcat will require some further configuration for Molgenis to run
    1. First edit the tomcat defaults (these are found in /etc/default/tomcat7). This special location is used to store admin settings which are likely to change and you want to keep across updates. sudo vim /etc/default/tomcat7
    2. Add the following line JAVA_HOME=/usr/lib/jvm/java-8-oracle to the file to make sure the JVM is the oracle one we installed above
    3. In the JAVA_OPTS line (this is used to set the JVM parameters):
      1. Change -Xmx parameter to whatever its value to -Xmx1g
      2. Add The following two properties -Dmolgenis.home=/var/lib/molgenis -Dlog4j.configuration=log4j-molgenis.properties
      3. The resulting line should look something like:
        JAVA_OPTS="-Djava.awt.headless=true -Xmx1g -XX:+UseConcMarkSweepGC -Dmolgenis.home=/var/lib/molgenis -Dlog4j.configuration=log4j-molgenis.properties"
    4. After these changes to Tomcat you will need to restart the application server with: sudo service tomcat7 restart
  2. MySQL will also require some additional setup (basically creating a username and a password).
    mysql -u root -p -e "create database molgenis; grant all on molgenis.* to 'molgenis'@'localhost' identified by 'YOUR_PASSWORD_HERE'; flush privileges;"
  3. Create a molgenis directory which is writable by the tomcat7 user (this is used for state information).
    sudo mkdir /var/lib/molgenis
    1. Set the correct permissions with sudo chown tomcat7:tomcat7 /var/lib/molgenis
  4. We need to create a properties file called molgenis-server.properties in the molgenis home directory (i.e. /var/lib/molgenis) specified above.
    sudo vim /var/lib/molgenis/molgenis-server.properties
    1. This properties file should contain the following (please make sure to substitute the MySQL molgenis user password with the correct one):
      #Molgenis server properties
       
      molgenis.version=13
      admin.password=MOLGENIS_ADMIN_PASSWORD_HERE_CHANGE!!!
      db_uri=jdbc\:mysql\://localhost/molgenis
      db_driver=com.mysql.jdbc.Driver
      db_user=molgenis
      db_password=MYSQL_MOLGENIS_PASSWORD_HERE_CHANGE!!!
      mail.host=localhost
      mail.port=25
    2. Note: The admin.password property is the one which the user admin uses to log in the molgenis system (from the frontend).
    3. The file is sensitive as it contains passwords, and should therefore be secured using the following:
      sudo chown tomcat7:tomcat7 /var/lib/molgenis/molgenis-server.properties
      sudo chmod 600 /var/lib/molgenis/molgenis-server.properties
  5. Download the latest version of molgenis web application file (this is in the form of a Java war).
    1. Do this by searching for molgenis-app in the maven repository
    2. Download the war file by using wget. e.g.
      wget http://search.maven.org/remotecontent?filepath=org/molgenis/molgenis-app/1.8.2/molgenis-app-1.8.2.war -O molgenis-app-1.8.2.war
  6. Rename the downloaded war file to ROOT.war (case important). This is an annoying and necessary limitation
  7. Make sure owner tomcat7 owns the file, sudo chown tomcat7:tomcat7 ROOT.war
  8. Copy the newly renamed ROOT.war to the Tomcat webs directory (by default this is in /var/lib/tomcat7/webapps)
    sudo cp -vp ROOT.war /var/lib/tomcat7/webapps
  9. If you want to follow what is going on, before copying set a tail -f /var/log/tomcat7/catalina.out
howto/molgenis_install.1440159515.txt.gz · Last modified: 2018/10/09 10:12 (external edit)