If you need a free hosting for your dynamic website you have very few choices (especially if you don’t use PHP). You can use the “free tier” of Heroku, but you’ll have some problems:

  1. Your application will go in sleep mode after 1 hour without any connections and then the first connection needs to wait for the restart of the “server”.

  2. From August 15, 2015 your free application must sleep 6 hours within a 24 hour period or they will shutdown your application for 6 hours.

You can find more details on Heroku devcenter.

Since I was using Heroku only for “hobby” and so I don’t want to pay $7/month, I looked for an alternative and I found OpenShift.

OpenShift is a platform as a service product from Red Hat. It is also an Infrastructure as a Service (IaaS), comparable to Google Storage and Amazon S3 online storage services. (from Wikipedia)

The free tier of OpenShift does not have the problems of the free tier of Heroku, the only limitation is that you can only have 3 website for each OpenShift account.

Since I develop my website using Ruby I tried to use the official Ruby 2.0 Cartridge, but I found that this cartridge includes Apache with old Passenger and Rack versions and this forces you to put gem 'rack', '1.5.2' to your Gemfile since requiring new versions prevent your application from starting.

They suggest to use a Do It Yourself cartridge and to configure all by yourself. I avoided this suggestion, because the Ruby 2.0 Cartridge is automatically updated for security problems and so I tried to workaround the problem.

My solution is an hack that prevents Apache to be started and it starts the Puma webserver instead (obviously this hack can be changed to start any other webserver).

If you want to study my hack and/or to use it you can find it on my Github repository.

To use my hack just create an application with the Ruby 2.0 Cartridge, clone my repository and use it as starting point for your application.

Or just replace your default .openshift directory with the .openshift directory taked from my repository.

blog comments powered by Disqus


24 June 2015