1. Java Web App Deployment in
Openshift Cloud
Abdullah Al Mamun Oronno
Senior Software Engineer,
Therap (BD) Ltd.
2. Installation Steps
1. Create an account in www.openshift.com
2. Create your first application in openshift through
Web Console; Add MySQL, PhpMyAdmin too.
3. Download and Install git
4. Download and install ruby
5. Install OpenShift Client Tools rhc throug ruby gem
gem install rhc --source http://rubygems.org
6. Setup openshift account to work from Bash
3. Sample Project
# Clone a sample java web application project developed from
https://github.com/oronno/WebApplication-Project-Skeleton
# From openshift’s phpmyadmin panel, create application’s
tables and data by importing sql file from config/database-webapp.sql
4. Build & Deploy Steps
1. Change the MySQL connection URL to:
jdbc:mysql://${OPENSHIFT_MYSQL_DB_HOST}:${OPENSHIFT_MYSQL_DB_
PORT}/webapp
2. Build application and create a war file
3. Rename the war file to ROOT.war
4. Copy the war file to remote openshift application server using command:
scp ROOT.war 548c89525973ca15b8000080@webapp-oneousdemo.
rhcloud.com:app-root/data/
5. Login to remote server using command:
ssh 548c89525973ca15b8000080@webapp-oneousdemo.rhcloud.com
6. Move the war to specific path to use it with Jboss Tomcat app server using
command:
mv app-root/data/ROOT.war app-root/dependencies/jbossews/webapps/
7. Restart the application server using command:
ctl_all restart