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.
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. This JDBC Driver is a java class which needs to be made available to tomcat. Two ways of doing this are either including /usr/share/java/mysql.jar
in the tomcat7 user's CLASSPATH env variable or copying this file to the Tomcat lib
directory as follows:
sudo cp -v /usr/share/java/mysql.jar /usr/share/tomcat7/lib
Note that Tomcat should be restarted after this file is copied over (for the class to be loaded). This can be done with:
sudo service tomcat7 restart
/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
JAVA_HOME=/usr/lib/jvm/java-8-oracle
to the file to make sure the JVM is the oracle one we installed aboveJAVA_OPTS
line (this is used to set the JVM parameters):-Xmx
parameter to whatever its value to -Xmx1g
-Dmolgenis.home=/var/lib/molgenis -Dlog4j.configuration=log4j-molgenis.properties
JAVA_OPTS="-Djava.awt.headless=true -Xmx1g -XX:+UseConcMarkSweepGC -Dmolgenis.home=/var/lib/molgenis -Dlog4j.configuration=log4j-molgenis.properties"
sudo service tomcat7 restart
mysql -u root -p -e "create database molgenis; grant all on molgenis.* to 'molgenis'@'localhost' identified by 'YOUR_PASSWORD_HERE'; flush privileges;"
tomcat7
user (this is used for state information).sudo mkdir /var/lib/molgenis
sudo chown tomcat7:tomcat7 /var/lib/molgenis
molgenis-server.properties
in the molgenis home directory (i.e. /var/lib/molgenis
) specified above.sudo vim /var/lib/molgenis/molgenis-server.properties
#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
admin.password
property is the one which the user admin
uses to log in the molgenis system (from the frontend).sudo chown tomcat7:tomcat7 /var/lib/molgenis/molgenis-server.properties sudo chmod 600 /var/lib/molgenis/molgenis-server.properties
wget http://search.maven.org/remotecontent?filepath=org/molgenis/molgenis-app/1.19.0/molgenis-app-1.19.0.war -O molgenis-app-1.19.0.war
ROOT.war
(case important). This is an annoying and necessary limitationsudo chown tomcat7:tomcat7 ROOT.war
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
sudo tail -f /var/log/tomcat7/catalina.out
<konsole> Aug 21, 2015 2:32:41 PM org.apache.catalina.startup.HostConfig deployWAR INFO: Deploying web application archive /var/lib/tomcat7/webapps/ROOT.war 14:33:04.641 [localhost-startStop-1] INFO o.m.d.e.f.EmbeddedElasticSearchServiceFactory - Embedded elasticsearch server started, data path=[/var/lib/molgenis/data] 14:33:07.379 [localhost-startStop-1] INFO o.m.d.version.MolgenisUpgradeService - MetaData version:13, current version:13 upgrade not needed 14:33:07.395 [localhost-startStop-1] INFO o.m.a.WebAppConfig$$EnhancerBySpringCGLIB$$183b5b00 - Reindexing repositories.... 14:33:09.499 [localhost-startStop-1] INFO o.m.a.WebAppConfig$$EnhancerBySpringCGLIB$$183b5b00 - Reindexing done. 14:33:09.551 [localhost-startStop-1] WARN o.m.data.mysql.MysqlRepository - Table for entity tags already exists. Skipping creation 14:33:09.576 [localhost-startStop-1] WARN o.m.data.mysql.MysqlRepository - Table for entity packages already exists. Skipping creation 14:33:09.678 [localhost-startStop-1] WARN o.m.data.mysql.MysqlRepository - Table for entity attributes already exists. Skipping creation 14:33:09.707 [localhost-startStop-1] WARN o.m.data.mysql.MysqlRepository - Table for entity entities already exists. Skipping creation 14:33:34.421 [localhost-startStop-1] ERROR o.m.d.support.AbstractEntityMetaData - No idAttribute specified for entityFileMeta, this attribute is required 14:33:34.427 [localhost-startStop-1] ERROR o.m.d.support.AbstractEntityMetaData - No idAttribute specified for entityFileMeta, this attribute is required 14:33:52.166 [localhost-startStop-1] INFO o.m.d.jpa.JpaRepositoryRegistrator - Registered JPA importer 14:33:52.167 [localhost-startStop-1] INFO o.m.d.m.EmxImportServiceRegistrator - Registered EMX import service 14:33:52.940 [localhost-startStop-1] INFO o.m.f.db.WebAppDatabasePopulator - initializing application database 14:34:40.345 [localhost-startStop-1] INFO o.m.f.db.WebAppDatabasePopulator - initialized application database 14:34:40.920 [localhost-startStop-1] INFO o.m.u.m.MenuManagerServiceImpl - Creating default menu from XML 14:34:43.557 [localhost-startStop-1] INFO o.m.script.ScriptRunnerFactory - Registering Script type R. 14:34:45.561 [localhost-startStop-1] INFO o.m.o.i.OntologyImporterServiceRegistrator - Registered ontology import service 14:34:51.415 [localhost-startStop-1] INFO o.m.o.i.OntologyScriptInitializerImpl - Script entity "roc" has been added to the database! 14:34:51.417 [localhost-startStop-1] INFO o.m.script.ScriptRunnerFactory - Registering Script type python. Aug 21, 2015 2:34:54 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-bio-8080"] Aug 21, 2015 2:34:54 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 133414 ms </konsole>
You can access the molgenis web app by pointing your web browser to http://127.0.0.1:8080