Here’s a little write-up regarding my experiences with creating a WebApp and uploading it to the CloudFoundry.com website. The first step is to go to the website and sign-up for an account, after signing up, you will receive an email within one business day containing a user ID and a password. Besides the username and password, the email contains some additional information including a link to the getting stared guide on the CloudFoundry.com website.
To start using CloudFoundry.com you should first download the vmc command line tool and change your password. To learn how to download and use this tool please follow the instructions here:
http://support.cloudfoundry.com/entries/20012337-getting-started-guide-command-line-vmc-users
gem install vmc
gem install Sinatra
============== System Services ==============
+---------+---------+-------------------------------+
| Service | Version | Description |
+---------+---------+-------------------------------+
| mysql | 5.1 | MySQL database service |
| redis | 2.2 | Redis key-value store service |
| mongodb | 1.8 | MongoDB NoSQL store |
+---------+---------+-------------------------------+
Put this in your pipe (taken from http://www.sinatrarb.com/)
require 'sinatra'
get '/hi' do
"Hello World! (Eric Sloof-NTPRO.NL)"
end
c:\Ruby192\hello>hello
== Sinatra/1.2.2 has taken the stage on 4567 for development with backup from WEBrick
[2011-04-13 13:10:47] INFO WEBrick 1.3.1
[2011-04-13 13:10:47] INFO ruby 1.9.2 (2011-02-18) [i386-mingw32]
[2011-04-13 13:10:47] INFO WEBrick::HTTPServer#start: pid=4676 port=4567
127.0.0.1 - - [13/Apr/2011 13:11:43] "GET /hi HTTP/1.1" 200 34 0.0068
EricSloof-PC - - [13/Apr/2011:13:11:43 W. Europe Daylight Time] "GET /hi HTTP/1.1" 200 34
- -> /hi
127.0.0.1 - - [13/Apr/2011 13:11:43] "GET /favicon.ico HTTP/1.1" 404 441 0.0010
EricSloof-PC - - [13/Apr/2011:13:11:43 W. Europe Daylight Time] "GET /favicon.ico HTTP/1.1" 404 441
- -> /favicon.ico
http://127.0.0.1:4567/hi
Hello World! (Eric Sloof-NTPRO.NL)
Now let’s push this WebApp to the cloud with c:\Ruby192\hello>vmc push hello and see what happens.
http://ntpro.cloudfoundry.com/hi
Hello World! (Eric Sloof-NTPRO.NL)