Install Mongrel for Ruby on Rails on Unix
By AkH, 3 years, 8 months ago,
Mongrel is an instance cluster, that gives you the opportunity to start N rails instance on the same apps. But this is not a load balancer.
./configure --prefix=/opt/rails/ruby-1.8.5 --enable-pthread --enable-thread
ln -s /opt/rails/ruby-1.8.5 /opt/rails/ruby
Get rubygem from rubyforge then:
sudo /opt/rails/ruby/bin/ruby setup.rb
sudo vi /opt/rails/ruby/bin/gem -> remove env and set the real ruby path
export PATH=/opt/rails/ruby/bin:$PATH
sudo /opt/rails/ruby/bin/gem install rails --include-dependencies
sudo /opt/rails/ruby/bin/gem install mongrel_cluster --include-dependencies
mkdir /opt/rails/data
mkdir /opt/rails/data/apps
Put your apps in /opt/rails/data/apps for example:
cd /opt/rails/data/apps
rails testapp
chown -R rails:rails testapp
cd testapp
mongrel_rails cluster::configure -e production -p 58000 -N 4 -c /opt/rails/data/apps/testapp -a 10.0.0.1 --user rails --group rails
10.0.0.1 stands for your ip where you want to listen
Start it with:
cd /opt/rails/data/apps/testapp
sudo mongrel_rails cluster::start
It will start 4 instances, binding port 58000 to 58003, you now need to have a load balancer to dispatch the connections.


Comments
ours de programmation Python Traduit à la base de How to Think Like a Computer Scientist
Traduction de Dive into Python Un peu plus complexe