Reply to topic
Up and Running with Ruby on Rails on a Linux VPS
comprug
Forum Regular

Joined: 15 Feb 2006
Posts: 341
Reply with quote
This article details how to setup a rails application on a Linux VPS. Although Apache is typically used to proxy requests to Mongrel, Apache is very bloated, and is a memory hog. Many Rails applications nowadays use a previously unheard of web server called "nginx".

First, we need to install Yum:
Code:
rpm -Uvh http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/os/Fedora/RPMS/python-elementtree-1.2.6-4.i386.rpm
rpm -Uvh http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/os/Fedora/RPMS/python-sqlite-1.1.6-1.i386.rpm
rpm -Uvh http://download.fedora.redhat.com/pub/fedora/linux/core/4/i386/os/Fedora/RPMS/python-urlgrabber-2.9.6-1.noarch.rpm
rpm-Uvh
http://download.fedora.redhat.com/pub/fedora/linux/core/updates/4/i386/yum-2.4.1-1.fc4.noarch.rpm

This will make the installation of several other things we need to install faster. Now let's create a user to run our app off of. Root is not safe.
Code:
useradd rails -g wheel
. To allow this user to sudo, we need to do the following:
type in "visudo". uncomment the line "%wheel ALL=(ALL) ALL". Type in ":write, and then :quit". This user can now sudo. now type in: passwd rails. You will be prompted to enter a new password for this user. Next, you need to log out. Log back in as that user. Use the password you just provided. Next we need to install ruby:
Code:
sudo yum install ruby irb rdoc ruby-devel openssl

Next Rubygems: (if no dir /usr/local/src, create it)
Code:

cd /usr/local/src
sudo wget http://rubyforge.org/frs/download.php/17190/rubygems-0.9.4.tgz
sudo tar -zxvf rubygems-0.9.4.tgz
cd rubygems-*
sudo ruby setup.rb

Now Rails: IF THIS FAILS THE FIRST TIME, TRY AGAIN. IT *WILL* WORK

sudo gem install rails --include-dependencies

Finally, before we install mongrel, we need to install gcc
Code:

sudo yum install gcc

Now we can install mongrel
Code:

sudo gem install mongrel mongrel_cluster gem_plugin --include-dependencies

We should now install mysql for ruby:
Code:

sudo gem install mysql
sudo yum install ruby-mysql
sudo yum install ruby-mysql.i386
(C Bindings)

Next we will create our rails app, setup the servers, configuration, and init.d scripts.
Up and Running with Ruby on Rails on a Linux VPS
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic