OpenRIMS-RPM - Installation Part 1: Difference between revisions

From OpenRIMS Wiki
Jump to navigation Jump to search
m (Khoppenworth moved page Installation Part1 to OpenRIMS - Installation Part 1 without leaving a redirect)
(Version 2)
Line 1: Line 1:


= Objective =
== Purpose ==
              This document helps deploy Pharmadex 2 software first time, along with the demo database.
This document describes deployment of OpenRIMS software on a default server.


The audience of it is IT persons that are responsible to install and maintain the Pharmadex 2 software. Minimal qualification requirements are:
The audience of it is IT persons that are responsible to install and maintain the OpenRIMS software.


·       Ability to install and configure programs and components in the selected Operation System.
You should have the ability to install and configure programs and components/services in the selected operating system.


·       The MySQL knowledge.
Additionally you need experience on MySQL.


== Pre-conditions ==
!'''PLEASE READ THE FULL DOCUMENT BEFORE PROCEDING WITH THE INSTALLATION!'''
              Regardless of deployment configuration selected, the following pre-conditions should be fulfilled:


·       At least 2 GB of free RAM
== Overview of Server Requirements ==
Regardless of deployment configuration selected, the following pre-conditions should be fulfilled:


·       At least 10GB of free SDD/HDD
=== Hardware Requirements ===
{| class="wikitable"
|+Checklist 1
|Memory
|At least 2 GB of free RAM
|
|-
|Harddrive
|At least 10GB of free SDD/HDD
|
|-
|Internet connection
|Should align with minimal requirements for Google Mail
|
|}


·       Operation Systems:
=== Software Requirements ===
{| class="wikitable"
|Operating System
|Linux, released after 2018. Tested on Ubuntu 18.04.4 LTS and above
OR


o  Windows Server 2016 and above
Windows Server 2016 and above
|
|-
|Database:
|MySQL : Server 5.7 and Workbench 8.0
|
|-
|Java:
|Oracle Java JDK 1.8
OR


o  Windows 10
OpenJDK 1.8


o  Linux, released after 2018. Tested on Ubuntu 18.04.4 LTS and above
''(OpenJDK 1.8 has been tested on Linux Ubuntu, but not Windows)''
|
|-
|OpenRIMS application & database:
|OpenRIMS Java application binary
AND


·       MySQL R 5.7
OpenRIMS demo database


o  Server
(<nowiki>https://github.com/MSH/Pharmadex2/tree/main/database</nowiki>[1])


o  Workbench
''(Please refer to the README.md file)''
|
|-
|Google Oauth ID & Secret
|A Google Mail account for OAuth Login SSO
|
|}


·       Oracle Java JDK 1.8. OpenJDK 1.8 has been tested on Linux Ubuntu, but not Windows
== The OpenRIMS Installation Procedure ==


·       Internet connection. Properties of it should suit minimal requirements for Google Mail
=== Prepare to install ===
1.      Install the following using the respective vendor’s deployment manuals:


·       Binary Pharmadex 2 distribution (see below)
1.1.   MySQL 5.7 : Server 5.7 and Workbench 8.0


·       Pharmadex 2 demo database (<nowiki>https://github.com/MSH/Pharmadex2/tree/main/database</nowiki>[1])
1.2.   Java JDK 1.8
 
2.      Restore the main database INCLUDING stored procedures to MySQL using MySQL Workbench or the command line. Name it '''pdx2'''. Verify that the stored procedures have been imported!
 
''Ubuntu MySQL CLI hint (<code>CREATE DATABASE pdx2</code>. And restore it: $ <code>mysql -u username -p pdx2 < DumpPdx2.sql</code>)''


·       The own, private Google Mail account
3.      Copy the binary application <code>pharmadex2-0.0.1.jar</code> and <code>application.properties</code> to a dedicated user folder, e.g. /home/{username}/applications/openrims


== Pharmadex 2 binary distribution ==
== Post-Installation OpenRIMS Configurations ==
The possibility to build the Pharmadex 2 software directly from the source codes is possible, however is not covered by this document. However, this manual describes deployment from the binary distribution. For current, the MSH staff may get this distribution from the corporative GitHub, address is


              The descriptions of binary components may be found in the respective file README.md
=== Local TCP/IP port ===
In the application.properties file edit the values marked bold (if it will be necessary):


= Steps to deploy =
==== Database ====
In the application.properties file edit the values marked bold:


== Prepare to install ==
<code>spring.datasource.url = jdbc:mysql://localhost/pdx2?useSSL=false&useUnicode=yes&characterEncoding=UTF-8&characterSetResults=UTF-8&'''serverTimezone=Europe/Kiev'''</code>
1.      Install using the vendor’s deployment manual:


1.1.   MySQL
<code>spring.datasource.username = '''username'''</code>


1.2.   Java JDK 1.8
<code>spring.datasource.password = '''password'''</code>
 
==== Logs ====
In the application.properties file edit the values marked bold:
 
<code>logging.file.path=/'''home/user/pharmadex/log'''</code>
 
<code>Recommended setting: '''logging.file.path= ./log/'''</code>
 
After configuration it will be necessary to copy Client ID and Client secret to the application.properties
 
==== OATH2 ====
<code>spring.security.oauth2.client.registration.google.client-id=client_id</code>
 
<code>spring.security.oauth2.client.registration.google.client-secret=client_secret</code>
 
== Install OpenRIMS as a service ==
Examples of the configurations are in the binary distributive on/from GitHub. The folders are “Windows” and “Linux”.
 
'''Linux'''
 
The official guide is here <nowiki>https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.nix-services.system-d</nowiki>
 
Here are detailed steps for Ubuntu 22.04:
 
# Copy file .service to /etc/systemd/system: <code>sudo cp openrims.service /etc/systemd/system</code>
# Edit file .service and change Username '''and''' Execstart path.
# Start the service: <code>systemctl enable openrims.service</code>
# Change Owner of the java application to your user: <code>sudo chmod a+rwx /home/ubuntu/applications/pharmadex2/pharmadex2-0.0.1.jar</code> OR <code>sudo cdmod 500 pharmadex2-0.0.1.jar</code>
 
For reference here is a sample service file:
 
"
 
<code>[Unit]</code>
 
<code>Description=Pharmadex 2 UAT version (madagascar)</code>
 
<code>After=pharmadex.service</code>
 
<code>[Service]</code>
 
<code>User=ubuntu</code>
 
<code>ExecStart=/home/{username}/applications/openrims/pharmadex2-0.0.1.jar</code>


2.      Restore the demo database to MySQL using MySQL Workbench or the command line
<code>SuccessExitStatus=143</code>


3.      Copy the binary application pharmadex2-0.0.1.jar  and application.properties to the dedicated folder, e.g. applications/pharmadex2
<code>[Install]</code>


== Configure ==
<code>WantedBy=multi-user.target</code>"


== Local TCP/IP port ==
In the application.properties file edit the values marked bold (if it will be necessary):


=== Database ===
              In the application.properties file edit the values marked bold:


spring.datasource.url = jdbc:mysql://localhost/pdx2?useSSL=false&useUnicode=yes&characterEncoding=UTF-8&characterSetResults=UTF-8&'''serverTimezone=Europe/Kiev'''
'''For Windows'''


spring.datasource.username = '''username'''
The official guide is here <nowiki>https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.windows-services</nowiki>


spring.datasource.password = '''password'''
== Provide access from the Internet ==
To provide access from the Internet it will be a good idea to establish a proxy gateway like Nginx or Apache2. The example of virtual server configuration for Apache 2 is in the binary distributive, folder “Linux”.


=== Logs ===
For Ubuntu 22.04 and Apache2 here are the steps:
              In the application.properties file edit the values marked bold:


logging.file.path=/'''home/alexk/pharmadex/log'''
# Copy pharmadex.conf to apache folder: sudo cp


the good choice is:
== Configuring Google Authentication ==
LINK: See '''[[Configuring Google Authentication for Pharmadex 2]]'''


'''logging.file.path= ./log/'''
== Special Configuration ==
----[1] This repository is not public yet.
LINK: See '''[[Installation part 3|IIS as a gateway for Spring Boot application]]'''
----[1] For current, available only to MSH staff

Revision as of 17:58, 24 July 2023

Purpose

This document describes deployment of OpenRIMS software on a default server.

The audience of it is IT persons that are responsible to install and maintain the OpenRIMS software.

You should have the ability to install and configure programs and components/services in the selected operating system.

Additionally you need experience on MySQL.

!PLEASE READ THE FULL DOCUMENT BEFORE PROCEDING WITH THE INSTALLATION!

Overview of Server Requirements

Regardless of deployment configuration selected, the following pre-conditions should be fulfilled:

Hardware Requirements

Checklist 1
Memory At least 2 GB of free RAM
Harddrive At least 10GB of free SDD/HDD
Internet connection Should align with minimal requirements for Google Mail

Software Requirements

Operating System Linux, released after 2018. Tested on Ubuntu 18.04.4 LTS and above

OR

Windows Server 2016 and above

Database: MySQL : Server 5.7 and Workbench 8.0
Java: Oracle Java JDK 1.8

OR

OpenJDK 1.8

(OpenJDK 1.8 has been tested on Linux Ubuntu, but not Windows)

OpenRIMS application & database: OpenRIMS Java application binary

AND

OpenRIMS demo database

(https://github.com/MSH/Pharmadex2/tree/main/database[1])

(Please refer to the README.md file)

Google Oauth ID & Secret A Google Mail account for OAuth Login SSO

The OpenRIMS Installation Procedure

Prepare to install

1.      Install the following using the respective vendor’s deployment manuals:

1.1.   MySQL 5.7 : Server 5.7 and Workbench 8.0

1.2.   Java JDK 1.8

2.      Restore the main database INCLUDING stored procedures to MySQL using MySQL Workbench or the command line. Name it pdx2. Verify that the stored procedures have been imported!

Ubuntu MySQL CLI hint (CREATE DATABASE pdx2. And restore it: $ mysql -u username -p pdx2 < DumpPdx2.sql)

3.      Copy the binary application pharmadex2-0.0.1.jar and application.properties to a dedicated user folder, e.g. /home/{username}/applications/openrims

Post-Installation OpenRIMS Configurations

Local TCP/IP port

In the application.properties file edit the values marked bold (if it will be necessary):

Database

In the application.properties file edit the values marked bold:

spring.datasource.url = jdbc:mysql://localhost/pdx2?useSSL=false&useUnicode=yes&characterEncoding=UTF-8&characterSetResults=UTF-8&serverTimezone=Europe/Kiev

spring.datasource.username = username

spring.datasource.password = password

Logs

In the application.properties file edit the values marked bold:

logging.file.path=/home/user/pharmadex/log

Recommended setting: logging.file.path= ./log/

After configuration it will be necessary to copy Client ID and Client secret to the application.properties

OATH2

spring.security.oauth2.client.registration.google.client-id=client_id

spring.security.oauth2.client.registration.google.client-secret=client_secret

Install OpenRIMS as a service

Examples of the configurations are in the binary distributive on/from GitHub. The folders are “Windows” and “Linux”.

Linux

The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.nix-services.system-d

Here are detailed steps for Ubuntu 22.04:

  1. Copy file .service to /etc/systemd/system: sudo cp openrims.service /etc/systemd/system
  2. Edit file .service and change Username and Execstart path.
  3. Start the service: systemctl enable openrims.service
  4. Change Owner of the java application to your user: sudo chmod a+rwx /home/ubuntu/applications/pharmadex2/pharmadex2-0.0.1.jar OR sudo cdmod 500 pharmadex2-0.0.1.jar

For reference here is a sample service file:

"

[Unit]

Description=Pharmadex 2 UAT version (madagascar)

After=pharmadex.service

[Service]

User=ubuntu

ExecStart=/home/{username}/applications/openrims/pharmadex2-0.0.1.jar

SuccessExitStatus=143

[Install]

WantedBy=multi-user.target"


For Windows

The official guide is here https://docs.spring.io/spring-boot/docs/current/reference/html/deployment.html#deployment.installing.windows-services

Provide access from the Internet

To provide access from the Internet it will be a good idea to establish a proxy gateway like Nginx or Apache2. The example of virtual server configuration for Apache 2 is in the binary distributive, folder “Linux”.

For Ubuntu 22.04 and Apache2 here are the steps:

  1. Copy pharmadex.conf to apache folder: sudo cp

Configuring Google Authentication

LINK: See Configuring Google Authentication for Pharmadex 2

Special Configuration

LINK: See IIS as a gateway for Spring Boot application


[1] For current, available only to MSH staff