English

Deploying a simple Merb application on Locaweb

Æ!!

I writing this post to help my friends of Rubylearning with a little Merb application deployment on Locaweb. I’m just translating some informations that you can find here in portuguese.

Lets start! :D

First open the Domain Manager ( Gerenciador de domínios ) on Locaweb Panel ( Painel da Locaweb ) and configure the pointer of your main site to  other directory on public_html of your account ( this directory don’t need to exist ). Follow this steps:

  1. Click on “alterar” ( change )
  2. Change the “Diretório Web” ( web directory ) to the new diretory
  3. And click on button “Salvar” ( save )

Transfer your application to a directory on your host. For this example, lets say that your application is called “sample_merb”, so, connect via SSH on your account and create the directory “rack_app”:

mkdir -p rack_app/sample_merb

And move your application to there.

Your application must to have a file called “config.ru” to be executed by Phusion Passenger, so, you need to create this file on your application folder ( rack_app/sample_merb on this case ) with this content:

require ‘rubygems’ require ‘merb-core’ Merb::Config.setup(:merb_root => “.”, :environment => ENV['RACK_ENV']) Merb.environment = Merb::Config[:environment] Merb.root = Merb::Config[:merb_root] Merb::BootLoader.run run Merb::Rack::Application.new

Now you need to create a symbolic link on your public_html diretory, as you have configured on your Domain Manager ( Gerenciador de Domínios ) of Locaweb Panel.

ln -s ~/rack_app/sample_merb/public ~/public_html/sample_merb

With this simple configuration you will have your application pointed by apache with Phusion Passenger.

Just to you know, you can see the merb gems that are installed with:

gem list | grep merb

Hope this help you on how to make your simple application works on Locaweb. ;)

Tags: , , ,

Wednesday, January 7th, 2009 English, Rubylearning No Comments

My last Tweet

Search