Friday, August 5, 2011

Installing Unicorn on Ubuntu (11.04)

Installed Unicorn.

1. Resources.
Unicorn: http://unicorn.bogomips.org/
Sleekd: http://sleekd.com/general/configuring-nginx-and-unicorn/

2. Install Unicorn
$ sudo gem install unicorn
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
Successfully installed rack-1.3.2
Successfully installed kgio-2.6.0
Successfully installed raindrops-0.7.0
Successfully installed unicorn-4.0.1
4 gems installed
Installing ri documentation for rack-1.3.2...
Installing ri documentation for kgio-2.6.0...
Installing ri documentation for raindrops-0.7
.0...
Installing ri documentation for unicorn-4.0.1...
Installing RDoc documentation for rack-1.3.2...
Installing RDoc documentation for kgio-2.6.0...
Installing RDoc documentation for raindrops-0.7.0...
Installing RDoc documentation for unicorn-4.0.1...

3. Check Installation
$ irb
irb(main):001:0> require "unicorn"
=> true
irb(main):002:0>

4. Test Run a Rack App (Ramaze)
$ cd work/ruby/ramaze/myapp          # my ramaze app
$ unicorn
I, [2011-08-06T11:33:11.738433 #1976]  INFO -- : listening on addr=0.0.0.0:8080 fd=3
I, [2011-08-06T11:33:11.738779 #1976]  INFO -- : worker=0 spawning...
I, [2011-08-06T11:33:11.739553 #1976]  INFO -- : master process ready
I, [2011-08-06T11:33:11.740215 #1978]  INFO -- : worker=0 spawned pid=1978
I, [2011-08-06T11:33:11.740420 #1978]  INFO -- : Refreshing Gem list
I, [2011-08-06T11:33:12.628489 #1978]  INFO -- : worker=0 ready

5. The Result at http://localhost:8080.

No comments:

Post a Comment