I recently spotted Thomas Fahle's post on OpenShift Express (Red Hat's Cloud) and I wanted to try it. I'm on Ubuntu, though, so the yum repository is no help. It turns out those rhc-* tools are written in Ruby, so...problem solved!
gem install rhc
Done! Wow. Alright, let's try it!
$ rhc-create-domain -n oylenshpeegul -l notmyrealaddress@example.com /usr/share/ruby-rvm/rubies/ruby-1.9.3-/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- openssl (LoadError) ...
Another snag! Apparently, Ruby is unhappy with Ubuntu's shiny new OpenSSL
$ openssl version OpenSSL 1.0.0e 6 Sep 2011
Instead, let's let rvm get a clunky old OpenSSL just for Ruby
$ rvm package install openssl
Fetching openssl-0.9.8n.tar.gz to /usr/share/ruby-rvm/archives
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3681k 100 3681k 0 0 91489 0 0:00:41 0:00:41 --:--:-- 111k
--no-same-owner
Configuring openssl in /usr/share/ruby-rvm/src/openssl-0.9.8n.
Compiling openssl in /usr/share/ruby-rvm/src/openssl-0.9.8n.
Installing openssl to /usr/share/ruby-rvm/usr
ERROR: Error running '/usr/bin/make install',
please read /usr/share/ruby-rvm/log/openssl/make.install.log
Oops.
$ sudo rvm package install openssl
Okay, now if we rebuild Ruby 1.9.3 with this OpenSSL
$ rvm remove 1.9.3 $ rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr $ rvm use 1.9.3 $ gem install rhc
we should be all set!
$ rhc-create-domain -n oylenshpeegul -l notmyrealaddress@example.com Created local config file: /home/tim/.openshift/express.conf express.conf contains user configuration and can be transferred across clients.
Whew! Okay, now back to Fahle's instructions
$ rhc-create-app -a X1 -t perl-5.10
Password:
Found a bug? Post to the forum and we'll get right on it.
IRC: #openshift on freenode
Forums: https://www.redhat.com/openshift/forums
Attempting to create remote application space: X1
...
Alright! If we visit http://X1-oylenshpeegul.rhcloud.com/, we see that OpenShift welcome page. Let's put something else there. If we create a file called X1/perl/hello.pl that looks like this
#!/usr/bin/perl use strict; use warnings; use CGI qw(:standard); print header, start_html('Hello'), p('Hello, world!'), end_html;
then we can upload it with git
$ cd X1 $ git add perl/hello.pl $ git commit -m 'say hello' $ git push
Now if we visit http://x1-oylenshpeegul.rhcloud.com/hello.pl, we see
Yay! OpenShift sure seems easy to use. Now for something a little more complicated...

Posted by: |