Download presentation
Presentation is loading. Please wait.
Published byHollie Stafford Modified over 9 years ago
1
Rails Hosting and Deployment
5
sudo apt-get install build-essential sudo apt-get install ruby ri rdoc ruby1.8-dev irb1.8 libnet-daemon-perl libplrpc-perl libreadline-ruby1.8 libruby1.8 rdoc1.8 ri1.8 ruby1.8 irb libopenssl-ruby libopenssl-ruby1.8 psmisc sudo apt-get install mysql-server libmysql-ruby libdbd-mysql-perl libdbi-perl libmysql-ruby1.8 libmysqlclient15off libmysqlclient-dev mysql-client-5.0 mysql-common mysql-server-5.0 sudo apt-get install libsqlite3-dev sqlite3 libsqlite3-ruby sudo apt-get install openssl libssl-dev
6
wget http://rubyforge.org/frs/download.php/56227/rubygems-1.3.3.tgz sudo ln -s /usr/bin/gem1.8 /usr/local/bin/gem sudo ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby sudo ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc sudo ln -s /usr/bin/ri1.8 /usr/local/bin/ri sudo ln -s /usr/bin/irb1.8 /usr/local/bin/irb sudo gem install rails --no-rdoc --no-ri sudo gem install mongrel --no-rdoc --no-ri sudo gem install mongrel_cluster --no-rdoc --no-ri sudo gem install mysql --no-rdoc --no-ri sudo gem install sqlite3-ruby --no-rdoc --no-ri
7
sudo aptitude install libc6 libpcre3 libpcre3-dev libpcrecpp0 libssl0.9.8 libssl-dev zlib1g zlib1g-dev lsb- base Build it from source wget http://sysoev.ru/nginx/nginx-0.6.36.tar.gzhttp://sysoev.ru/nginx/nginx-0.6.36.tar.gz./configure --sbin-path=/usr/local/sbin --with-http_ssl_module make sudo make install
8
sudo apt-get openssh-server openssh-client
9
sudo vi /etc/init.d/nginx Article for creating the nginx start/stop script: http://articles.slicehost.com/2009/3/4/ubuntu- intrepid-adding-an-nginx-init-scripthttp://articles.slicehost.com/2009/3/4/ubuntu- intrepid-adding-an-nginx-init-script Try: sudo /etc/init.d/nginx start sudo /etc/init.d/nginx stop sudo /etc/init.d/nginx restart
12
upstream demo_cluster { server 127.0.0.1:3000; server 127.0.0.1:3001; server 127.0.0.1:3002; server 127.0.0.1:3003; }
13
monit example confiiguration: check process app-mongrel-5200 with pidfile /home/railsuser/demo/shared/tmp/mongrel.3000.pid start program = "/usr/bin/mongrel_rails cluster::start -C /home/railsuser/demo/current/config/mongrel/production.yml --clean --only 3000" as uid railsuser and gid railsuser stop program = "/usr/bin/mongrel_rails cluster::stop -C /home/railsuser/demo/current/config/mongrel/production.yml --clean --only 3000" as uid railsuser and gid railsuser if totalmem is greater than 100.0 MB for 2 cycles then restart if failed port 5200 protocol http # check for response with timeout 10 seconds then restart if cpu is greater than 80% for 3 cycles then restart if cpu is greater than 50% for 2 cycles then alert group app-mongrel
15
Execute this on the server(s) your deploying from: sudo gem install capistrano Other gem dependencies include: sudo gem install net-scp sudo gem install net-ssh sudo gem install net-ssh-gateway sudo gem install net-sftp Execute this at the root of your Rails stack: capify
16
Default commands are usually enough for the simplest Rails Applications Need a new script called script/spin Custom tasks need to be created for: monit, various deployment environments (test, staging, etc) cap deploy:setup cap deploy:check cap deploy:update cap deploy:start, stop, restart cap deploy
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.