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!
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:
- Click on “alterar” ( change )
- Change the “Diretório Web” ( web directory ) to the new diretory
- 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.
No comments yet.
Leave a comment
Search
Recent Posts
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.
Categories
Personal Links
Archives
- May 2011
- April 2011
- March 2011
- January 2011
- December 2010
- October 2010
- September 2010
- August 2010
- July 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008