...
- Add a DIY cartridge.
- Add MySQL cartridge to the previously created one (OpenShift console -> cartridge -> Databases -> Add MySQL).
- Prepare to change the cartridge:
- Clone its repository:
git clone ssh://$OPENSHIFT_APP_UUID@$OPENSHIFT_APP_DNS/~/git/openmrs.git/
Move to the resulting directory:
cd openmrs/
- Clone its repository:
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
- Check if Tomcat has started successfully by visiting your server via browser (URL is written on cartridge's page in console).
- Deploy OpenMRS to server:
- Download the app archive (version specified here is the most recent one by the time of writing) into tomcat webapps directory:
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).
- Download the app archive (version specified here is the most recent one by the time of writing) into tomcat webapps directory:
- Configure OpenMRS on low level: (using custom openmrs runtime properties file method: Overriding OpenMRS Default Runtime Properties)
Set proper OpenMRS configuration file path (via env var):
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):
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
- Commit and push the changes:
git add diy/openmrs/openmrs-runtime.properties
git commit -m 'Configured OpenMRS'
git push
- Proceed to high-level OpenMRS configuration via browser. You should not select 'Simple' as type of installation as it assumes having MySQL root, etc.
...