Translate

Sunday, April 21, 2013

Server setup for Ruby on Rails on Debian


Hello Ruby on Rails people,in this post i will explain how to setup server for Ruby on Rails on Debian Linux.

Debian Server Setup (Rails 3.2.x, Ruby 1.9.3-p0, Apache-Passenger)
taken from link  :
OS: Debian 6.0
Software Versions: Git 1.7.9.1, Ruby 1.9.3-p125, Rails 3.2.1, RubyGems 1.8.17, Git
Apache2,
Debian updates
-
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
sudo apt-get install python-software-properties
sudo apt-get install libssl-dev libreadline-dev
Install Git
-
cd /usr/local/src
sudo wget http://kernel.org/pub/software/scm/git/git-1.7.5.2.tar.bz2
sudo bunzip2 git-1.7.5.2.tar.bz2
sudo tar xvf git-1.7.5.2.tar
cd git-1.7.5.2
sudo apt-get install tcl
sudo apt-get install tk
sudo apt-get install zlib1g-dev
sudo ./configure
sudo make && sudo make install
Install libyaml for Ruby 1.9.3-p0
-
cd /usr/local/src
sudo wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
sudo tar zxf yaml-0.1.4.tar.gz
cd yaml-0.1.4
sudo ./configure --prefix=/usr/local
sudo make && make install
Install Ruby 1.9.3-p0
-
cd /usr/local/src
sudo wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
sudo tar -zvxf ruby-1.9.2-p180.tar.gz
cd ruby-1.9.2-p180
sudo ./configure --enable-shared
sudo make && sudo make install
ruby –v
Install RubyGems
-
cd /usr/local/src
sudo wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.17.tgz
sudo tar xzvf rubygems-1.8.17.tgz
cd rubygems-1.8.17
sudo ruby setup.rb
sudo gem install rubygems-update
sudo update_rubygems
Install Rails
-
sudo gem install rake
sudo gem install rails
gem install bundler
Install MySQL
-
sudo apt-get install mysql-server-5.0 libmysqlclient15-dev
sudo gem install mysql
gem install mysql2
Install Node.js (prevent requiring therubyracer gem at every install)
-
cd /usr/local/src/
sudo wget http://nodejs.org/dist/v0.6.11/node-v0.6.11.tar.gz
sudo tar -zxf node-v0.6.7.tar.gz
cd node-v0.6.7
sudo ./configure
sudo make && sudo make install
Install Apache and Passenger
-
sudo apt-get install apache2
sudo gem install passenger
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install apache2-prefork-dev
sudo apt-get install libapr1-dev
sudo apt-get install libaprutil1-dev
sudo passenger-install-apache2-module
Add Apache conf
-
LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-
3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.11
PassengerRuby /usr/local/bin/ruby

No comments:

Post a Comment