Overview

This guide will show you how to configure a Media Temple VPS (DV) or dedicated server to deliver Ruby applications with Phusion Passenger. Passenger is an open source web application server for Ruby. This is a from-scratch installation guide that will take you through the complete setup process. Please keep in mind that this article is provided as a courtesy. Third party applications are outside of the Media Temple scope of support. Media Temple is not responsible for the performance of Passenger and these instructions could change at any time. Please read our statement of support.

Instructions

To take advantage of this guide, you will need to be able to SSH to your server with root privileges. You'll also need basic familiarity with BASH editors like vim or nano. These instructions are specific to (mt) Media Temple VPS customers that are using CentOS 7. Always start new installations by making sure that all of your packages are up to date. SSH to your server and execute the following:

yum -y update

1. Install RVM

Once your update completes, install Ruby Version Manager. RVM is a popular open source package manager. You may already be using a different package manager such as Rbenv, which should work fine.

2. Install Ruby

Install Ruby once the RVM installation completes. You can use any version that you need, but you may need to target a specific version depending on whether you already have an application built and ready to deploy.

For the latest version:

rvm install ruby
rvm --default use ruby

For a specific version, replace the 'V's with your desired version number:

rvm install ruby-V.V.V
rvm --default use ruby-V.V.V

3. Install Bundler

Bundler is an easy to use Ruby application dependency manager. Without Bundler or an equivalent tool, you will have to install each application dependency manually.

gem install bundler --no-rdoc --no-ri

4. Install node.js

node.js is required by Ruby on Rails for its JavaScript runtime environment. Install node.js if you plan on using Ruby on Rails.

5. Install Passenger with Nginx

It's a relatively straightforward process, but if you become stuck, Phusion has great tutorials on their site that can help you troubleshoot. The following commands will add Phusion's Yum repository and then download and install the required packages. Passenger uses a modified version of the Nginx web server. If you're already using a different web server such as Apache, or already have Nginx installed, this installation will still work.

Find the following lines and remove the '#'. Passenger's documentation indicates that it's possible that these lines may not be there. If this is the case, cut and paste the uncommented lines below (remove the #) into passenger.conf.

You should receive a printout validating the installation. If you don't, use the instructions and whatever error messages appear to troubleshoot the issue. You may also consult Phusion's documenatation.

* Checking whether this Phusion Passenger install is in PATH... ✓
* Checking whether there are no other Phusion Passenger installations... ✓

Update and reboot

yum -y update
yum reboot

Your server is now configured to deliver Ruby applications using a Passenger web application server. If you have any questions or concerns, please feel free to contact our award winning 24/7 support team.