Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Note

This page is outdated and no longer receives updates!

OpenShift is a PAAS by RedHat one may use for easy OpenMRS deployment with low initial cost and easy scaling. Unlike IAAS (VDS such as EC2) it does not require manual server administration - one may just deploy an app, while care of hosting management is taken by RedHat.

...

Anchor
video
video
Video Guide: Deploying OpenMRS on OpenShift on Mac or Linux

Widget Connector
overlayyoutube
_templatecom/atlassian/confluence/extra/widgetconnector/templates/youtube.vm
width400px
urlhttps://www.youtube.com/watch?v=1ZvH1YgaN0s
height300px

Installing OpenMRS on OpenShift - Abbreviated for Mac and Linux

Anchor
video
video
Video Guide: Deploying OpenMRS on OpenShift on Windows

Widget Connector
overlayyoutube
_templatecom/atlassian/confluence/extra/widgetconnector/templates/youtube.vm
width400px
urlhttps://www.youtube.com/watch?v=W0kANQIbl3A
height300px

Installing OpenMRS on OpenShift - Abbreviated for Windows

 

Info

You should replace variables (such as $OPENSHIFT_APP_UUID) with their real values except while working on the server/having them declared in some other way.

Step-by-step guide

  1. Add a DIY cartridge.

  2. Add MySQL cartridge to the previously created one (OpenShift console -> cartridge -> Databases -> Add MySQL).

  3. Prepare to change the cartridge:

    1. Clone its repository: 

      1. git

...

      1. clone

...

      1. ssh://$OPENSHIFT_APP_

...

      1. UUID@$OPENSHIFT_APP_DNS/~/git/openmrs.git/

    1. Move to the resulting directory:

      1. cd

...

      1. openmrs/

  1. Deploy custom Tomcat (Custom here means not the default one for OpenShift. In fact, this variant is upstream.)

    1. git

...

    1. remote

...

    1. add

...

    1. tomcat-upstream

...

    1. -m

...

    1. master

...

    1. git://github.com/openshift-quickstart/openshift-tomcat-quickstart.git

    2. git

...

    1. pull

...

    1. -s

...

    1. recursive

...

    1. -X

...

    1. theirs

...

    1. tomcat-upstream

...

    1. master

    2. git

...

    1. push

    2. Check if Tomcat has started successfully by visiting your server via browser (URL is written on cartridge's page in console).

  1. Deploy OpenMRS to server:

    1. Download the app archive (version specified here is the most recent one by the time of writing) into tomcat webapps directory:

      1. curl

...

      1. -L

...

      1. http://sourceforge.net/projects/openmrs/files/releases/OpenMRS_Platform_1.10.1/openmrs.war/download

...

      1. -o

...

      1. diy/tomcat/webapps/openmrs.war

    1. git

...

    1. add

...

    1. diy/tomcat/webapps/openmrs.war

    2. git

...

    1. commit

...

    1. -m

...

    1. 'Deployed

...

    1. OpenMRS

...

    1. Platform

...

    1. 1.10.1'

    2. git

...

    1. push

    2. Check if it has started succesfully by

...

    1. visiting http://$OPENSHIFT_APP_DNS/

...

    1. openmrs (default path).

  1. Configure OpenMRS on low level:

    1. Set proper OpenMRS configuration file path (via env var (see Overriding OpenMRS Default Runtime Properties)):

      1. ssh to the server

      2. echo

...

      1. "/var/lib/openshift/$OPENSHIFT_APP_UUID/app-deployments/current/repo/diy/openmrs/openmrs-runtime.properties"

...

      1. >

...

      1. .env/user_vars/OPENMRS_RUNTIME_PROPERTIES_FILE

      2. Exit the server

    1. Set proper app data directory (default is ~/.OpenMRS; these commands are to be run in the git repository associated with your cartridge):

      1. mkdir

...

      1. diy/openmrs

      2. echo

...

      1. "application_data_directory=/var/lib/openshift/$OPENSHIFT_APP_UUID/app-deployments/current/repo/diy/openmrs"

...

      1. > diy/openmrs/openmrs-runtime.properties

    1. Add MySQL configuration to OpenMRS config:

      1. echo

...

      1. "###

...

      1. Database

...

      1. connection

...

      1. properties
        connection.username=$OPENSHIFT_MYSQL_DB_USERNAME
        connection.password=$OPENSHIFT_MYSQL_DB_PASSWORD
        connection.url=jdbc:mysql://$OPENSHIFT_MYSQL_DB_HOST:$OPENSHIFT_MYSQL_DB_PORT/$OPENSHIFT_APP_NAME?autoReconnect=true"

...

      1. >> diy/openmrs/openmrs-runtime.properties

    1. Commit and push the changes:

      1. git

...

      1. add

...

      1. diy/openmrs/openmrs-runtime.properties

      2. git

...

      1. commit

...

      1. -m

...

      1. 'Configured

...

      1. OpenMRS'

      2. git

...

      1. push

  1. Proceed to high-level OpenMRS configuration via browser. You should not select 'Simple' as type of installation as it assumes having MySQL root, etc.

Info

Don't forget to change your Tomcat manager password! (The default account is tomcat:openshift, can be altered by editing diy/tomcat/conf/tomcat-users.xml and pushing).

Filter by label (Content by label)
showLabelsfalse
max5
spacesdocs
showSpacefalse
sortmodified

...

reversetrue
typepage
cqllabel in ( "installation" , "step-by-step" , "install" , "how-to" , "openshift" , "recipe" , "implementers" ) and type = "page" and space = "docs"
labelsinstallation recipe how-to install implementers step-by-step openshift