Free java hosting with OpenShift
by mmahmoodict on 10 Jun 2013 18:01
Configure OpenShift client tool -
$ sudo apt-get install ruby-full rubygems git-core
$ sudo gem install rhc
$ rhc setup
Create a Tomcat7 App -
$ rhc create-app mytestapp jbossews-2.0
This will create following directories and files under 'mytestapp' directory -
.
├── pom.xml
├── README.md
├── src
│ └── main
│ ├── java
│ ├── resources
│ └── webapp
│ ├── images
│ │ └── jbosscorp_logo.png
│ ├── index.html
│ ├── snoop.jsp
│ └── WEB-INF
│ └── web.xml
└── webapps
└── ROOT.war
Change something, like index.html
vim src/main/webapp/index.html
Commit and push, it will update your server code and restart app server.
git commit -a -m 'first commit, change in index.html'
git push
See change here -
http://mytestapp-mahout.rhcloud.com/
SSH to your server :-), go to -
https://openshift.redhat.com/app/console/applications/mytestapp
You will find something like this -
ssh://51b60c36e0b8cd39dc0001ve@mytestapp-mahout.rhcloud.com/~/git/mytestapp.git/
So, from terminal -
ssh 51b60c36e0b8cd39dc0001ve@mytestapp-mahout.rhcloud.com