Table of Contents |
---|
Introduction
...
- Install/Setup pre-requisite software. These pre-requisites can be downloaded from http://www.openspecimen.org/prerequisites/
- Use the below command to download the source code:
$ git clone --depth 10 https://github.com/krishagni/openspecimen.git
- Above command will checkout the master branch or unreleased version of code. If you wish to build source code of a specific release then use below command before proceeding to build. The list of available release version tags can be view here: https://github.com/krishagni/openspecimen/releases
$ git checkout <release-version-tag>
$ git checkout v6.1.RC7 # example to checkout source code of OpenSpecimen
v6.1.RC7
Do all the pre-requisites setup before deploying WAR file.
- Use
gradle
to build and deploy the application.
...
- For database privileges, refer to Database Configuration
- Java 8 JRE and JAVA_HOME is set.
- MySQL on Linux: MySQL Case Sensitivity issues on Linux
Following table lists pre-requisites and their supported versions.
...
Database | Command |
---|---|
MySQL |
|
Oracle |
Note: |
Configure Tomcat context.xml
Note: This section is applicable for the fresh install and upgrading OpenSpecimen from older versions before v5.0.
For Linux, configure the PID.txt path using the instructions here: How to run Tomcat using PID on Linux?
Refer to the attached context.xml for reference.
Configure the data source name in $TOMCAT_HOME/conf/context.xml using the snippet below.
Code Block |
---|
<Resource name="jdbc/openspecimen" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="<db_user_name>" password="<db_password>" driverClassName="<DRIVER_CLASS_NAME>" url="<DB_URL>" testOnBorrow="true" validationQuery="select 1 from dual" /> |
MySQL | Oracle | |
---|---|---|
Driver class name | com.mysql.jdbc.Driver | oracle.jdbc.OracleDriver |
DB URL | jdbc:mysql://<db_host>:<db_port>/<db_name> | jdbc:oracle:thin:@<db_host>:<db_port>:<dbname> |
Add below XML fragment
...
below <Resource>
tag in $TOMCAT_HOME/conf/context.xml
Code Block |
---|
<Environment name="config/openspecimen" value="$TOMCAT_DIR/conf/openspecimen.properties" type="java.lang.String"/> |
Note: The word "openspecimen" above could be different based on your configuration. E.g. "os-test", "os-prod" etc.
Edit "openspecimen.properties"
Note: Please make sure data & plugin directory are present at the specified path.
Attaching openspecimen.properties.
Field | Description | Values |
---|---|---|
app.name | This field is useful for deploying multiple OpenSpecimen instances on the same Tomcat server. E.g. You can use "os-test" and "os-prod". | Typically this is "openspecimen". |
tomcat.dir | The absolute path to the Tomcat directory | |
app.data_dir | Absolute path to OpenSpecimen data directory. | Best practice: Create a folder in parallel to 'tomcat.dir' with the name "OpenSpecimen/data" |
app.log_conf | The folder where the OpenSpecimen logs should be created | If left empty logs are created in "app.data_dir/logs" |
datasource.jndi | Name of datasource configured in "context.xml" | Usually, it is "jdbc/openspecimen". |
datasource.type | "fresh": If your database schema is created by OpenSpecimen from scratch. "Upgrade": if your database schema is upgraded from a caTissue database. Note: The name is a bit misleading, we will fix this in v5.2. | "fresh" or "upgrade" |
database.type | MySQL or Oracle | "mysql" or "oracle" |
plugin.dir | Absolute path to the plugin directory. | Best practice: Create a folder in parallel to 'tomcat.dir' with the name "OpenSpecimen/plugins" |
Configure build.properties
Property Name | Description | Default Value | Allowed Values |
---|---|---|---|
app_home | The absolute path of the directory where Tomcat server is extracted and installed. | None | Example: /usr/local/openspecimen/tomcat-as |
...
- Open command terminal
- Change to the directory where OpenSpecimen source code is checked-out
cd $OS_HOME
- Setup npm & bower dependencies.
cd www/
npm install
bower install
Note: Above commands needs to be executed successfully.
- Change directory to root directory of source code.
cd ..
- Use the following command to build and deploy OpenSpecimen into app_home directory (Tomcat or JBoss server).
gradle deploy
- To only compile Java source files use the following command
gradle compileJava
- To build OpenSpecimen web app archive without deploying use following command
gradle build
Once "gradle deploy" is ran successfully, start the Tomcat process and monitor the log files.
...