Wiki Spaces
Documentation
Projects
Resources
Get Help from Others
Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack
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.
This guide assumes you already have an OpenShift account with domain selected and SSH keys added.
Commands specified are valid for *nix environment, adaptation to others is trivial though.
Installing OpenMRS on OpenShift - Abbreviated for Mac and Linux
Installing OpenMRS on OpenShift - Abbreviated for Windows
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.
git clone ssh://$OPENSHIFT_APP_UUID@$OPENSHIFT_APP_DNS/~/git/openmrs.git/
Move to the resulting directory:
cd openmrs/
Deploy custom Tomcat (Custom here means not the default one for OpenShift. In fact, this variant is upstream.)
git remote add tomcat-upstream -m master git://github.com/openshift-quickstart/openshift-tomcat-quickstart.git
git pull -s recursive -X theirs tomcat-upstream master
git push
curl -L http://sourceforge.net/projects/openmrs/files/releases/OpenMRS_Platform_1.10.1/openmrs.war/download -o diy/tomcat/webapps/openmrs.war
git add diy/tomcat/webapps/openmrs.war
git commit -m 'Deployed OpenMRS Platform 1.10.1'
git push
Check if it has started succesfully by visiting http://$OPENSHIFT_APP_DNS/openmrs (default path).
Set proper OpenMRS configuration file path (via env var (see Overriding OpenMRS Default Runtime Properties)):
ssh to the server
echo "/var/lib/openshift/$OPENSHIFT_APP_UUID/app-deployments/current/repo/diy/openmrs/openmrs-runtime.properties" > .env/user_vars/OPENMRS_RUNTIME_PROPERTIES_FILE
Set proper app data directory (default is ~/.OpenMRS; these commands are to be run in the git repository associated with your cartridge):
mkdir diy/openmrs
echo "application_data_directory=/var/lib/openshift/$OPENSHIFT_APP_UUID/app-deployments/current/repo/diy/openmrs" > diy/openmrs/openmrs-runtime.properties
Add MySQL configuration to OpenMRS config:
echo "### Database connection 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" >> diy/openmrs/openmrs-runtime.properties
git add diy/openmrs/openmrs-runtime.properties
git commit -m 'Configured OpenMRS'
git push
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).