How To Deploy a Rails App with Passenger and Apache on Ubuntu
Ruby
|
Wednesday, 16 August 2017
In this tutorial, we will demonstrate how to install Phusion Passenger as your Rails-friendly web server, which is easy to install, configure, and maintain. We will integrate it into Apache on Ubuntu 16.04. By the end of this tutorial, we will have a test Rails application deployed.
Step 1 — Install Ruby
We will install Ruby manually from source.
Before we do anything else, we should run an update to make sure that all of the packages we want to install are up to date:
Step 2 — Install Rails
Since Rails ships with so many dependencies these days, we’re going to need to install a Javascript runtime like NodeJS. This lets you use Coffeescript and the Asset Pipeline in Rails which combines and minifies your javascript to provide a faster production environment.
To install NodeJS, we’re going to add it using the official repository:
And now for the moment of truth. Let’s create your first Rails application in /var/www:
Step 3 — Install Apache
To install Apache, type this command:
Yes, that’s all!
Step 4 — Install Passenger
Step 5 — Deploy
At this point you can deploy your own Rails application if you have one ready.
Disable the default site, enable your new site, and restart Apache: