Note: on both servers we set selinux in permissive mode:
In /etc/sysconfig/selinux
SELINUX=permissive |
Install the backend (transmart-core)
Install packages
First install all required packages with following commands:
sudo tee /etc/yum.repos.d/thehyve_internal.repo <<EOD [thehyve_internal] gpgcheck=0 baseurl=https://repo.thehyve.nl/content/repositories/releases enabled=1 name=The Hyve Internal RPM releases EOD sudo yum localinstall \ https://yum.postgresql.org/9.6/redhat/rhel-6-x86_64/pgdg-redhat96-9.6-3.noarch.rpm sudo yum install -y \ php55-cli-minimal \ make \ git \ java-1.8.0-openjdk \ groovy \ postgresql96 \ httpd \ postgresql96-server |
Configure apache
Make apache start on each bood
sudo systemctl enable httpd.service |
Create virtual host for the application by creating /etc/httpd/conf.d/transmart.conf file with below content:
<VirtualHost *:80> Redirect permanent / https://<host>/ </VirtualHost> <VirtualHost *:443> ## Vhost docroot DocumentRoot "/var/www/html" ## Directories, there should at least be a declaration for /var/www/html <Location "/"> </Location> ## Logging ErrorLog "/etc/httpd/logs/transmart-revproxy-local_error.log" ServerSignature Off CustomLog "/etc/httpd/logs/transmart-revproxy-local_access.log" combined ## Proxy rules ProxyRequests Off ProxyPreserveHost Off ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ </VirtualHost> |
Start the apache server:
sudo systemctl start httpd.service |
Create the database
Make sure database users could login with password. Make sure /var/lib/pgsql/9.6/data/pg_hba.conf file has below line:
host all all 127.0.0.1/32 md5 |
Initialize a database and start the server.
sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb sudo systemctl enable postgresql-9.6.service sudo systemctl start postgresql-9.6.service |
Clone schema from the github as postgres user:
sudo su postgres cd /tmp git clone --depth 1 https://github.com/thehyve/transmart-core.git cd transmart-core/transmart-data/ |
Create environment variables file: Name it e.g. vars
PGHOST= PGPORT=5432 PGDATABASE=transmart PGUSER=postgres PGPASSWORD= PGSQL_BIN=/usr/bin/ TABLESPACES=/var/lib/pgsql/9.6/tablespaces/ export PGHOST PGPORT PGDATABASE PGUSER PGPASSWORD TABLESPACES PGSQL_BIN |
Source the env. var. file:
source vars |
And create the schema with:
make postgres |
Generate configuration files:
TSUSER_HOME=/tmp/ make -C config install |
Exit from postgres user.
Install transmart application
Create transmart user:
sudo useradd transmart |
Move previously generated configuration files to his home folder:
sudo mv /tmp/.grails/ /home/transmart/ sudo chown -R transmart:transmart ~transmart/.grails |
And change ~transmart/.grails/transmartConfig/Config.groovy
From: | def glowingBearRedirectUris = [ org.transmartproject.app.transmartURL - ~/transmart\/?$/ + 'connections', ] // for dev, node reverse proxy runs on 8001 glowingBearRedirectUris << 'http://localhost:8001/connections' |
To: | def glowingBearRedirectUris = ['http://<IP>'] |
Add also cross origin setting to the configuration file:
grails.cors.enabled = true grails.cors.allowedOrigins = http://<IP> |
Download the latest transmart-core version with:
Create start_transmart.sh script with following content:
java -jar -server -Xms3000m -Xmx3000m -Djava.awt.headless=true -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dserver.port=8080 -Djava.security.egd=file:///dev/urandom transmart-server-17.1-SNAPSHOT.war |
Make it executable:
chmod +x start_transmart.sh |
Make transmart service
Create /etc/systemd/system/transmart.service
[Unit] Description=TranSMART After=network.target [Service] Type=simple User=transmart WorkingDirectory=/home/transmart ExecStart=/home/transmart/start_transmart.sh Restart=on-abort [Install] WantedBy=multi-user.target |
Start with:
systemctl enable transmart.service systemctl start transmart.service |
Enable https (did not make it work)
Follow https://wiki.thehyve.nl/display/CMIshared/How+to+configure+Mica+Apache+HTTPS+on+CentOS
Install frontend (glowing bear)
Create glowingbear user and get recent glowing bear application:
sudo useradd glowingbear sudo su glowingbear cd ~ chmod o+x . tar -xvf TM-GBFRONT-JOB1-0.0.1-SNAPSHOT.tar |
Make sure other linux users would be able read the folder content:
chmod -R 644 TM-GBFRONT-JOB1-0.0.1-SNAPSHOT find TM-GBFRONT-JOB1-0.0.1-SNAPSHOT -type d -exec chmod o+x {} + |
Change configurations in TM-GBFRONT-JOB1-0.0.1-SNAPSHOT/app/config/config.prod.json to:
Install apache
sudo yum install -y httpd sudo systemctl enable httpd.service |
Create /etc/httpd/conf.d/glowingbear.conf with folowing content:
<VirtualHost *:80> ## Vhost docroot DocumentRoot "/home/glowingbear/TM-GBFRONT-JOB1-0.0.1-SNAPSHOT" <Directory "/home/glowingbear/TM-GBFRONT-JOB1-0.0.1-SNAPSHOT"> Options Indexes FollowSymLinks MultiViews AllowOverride None Require all granted </Directory> ## Logging ErrorLog "/etc/httpd/logs/gb_error.log" ServerSignature Off CustomLog "/etc/httpd/logs/gb_access.log" combined ## Rewrite rules RewriteEngine On #If an existing asset or directory is requested go to it as it is RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d RewriteRule ^ - [L] #If the requested resource doesn't exist, use index.html RewriteRule ^ /index.html </VirtualHost> |
And start the service:
sudo systemctl start httpd.service |
Check that application works.