How to deploy a Rails application with Passenger and Nginx on Ubuntu 14.04 Part I

Tram Ho

Introduce

If you are a rails dev you probably need a web host to deploy your application. This is a tutorial on how to use the Passenger phusion to deploy your application. Other passengerser to easily install, configure and maintain it can use nginx or apache. In this tutorial I will use passenger with nginx on ubuntu 14.04.

An alternative method of deploying your Rails application is with this 1-Click Rails Installation using Nginx with Unicorn, an HTTP server that can handle multiple requests simultaneously.

Step 1 Create a droplet

Creating ubuntu 14.04 droplet. There are many versions you can choose with the small web can choose about 512MB capacity.

And depending on your needs, you can choose either 64bit or 32bit.

Step 2 Add sudo user

After creating the droplet you need a user to administer and secure the system. Specifically, everyone has more to see in this article. https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-14-04

Step 3 install domain

Step setup domain, yes or no this is optional. Because you can access it via IP address.

Step 4 install ruby

Next we will install ruby ​​and the first thing is to update the necessary packages

Next, we will install some dependencies. For the most inert operating system.

Create a temporary folder to store ruby.

Move to the newly created folder

Download and extract ruby

Move to the ruby ​​directory which has just been compressed and run the script

The above command will run to check the dependencies and create a Makefile to be able to run the compile code and run make to run the Makefile file.

Next run

and check the ruby ​​version

ok ruby ​​has been installed, you can delete the temporary ruby ​​folder.

sudo apt-key adv –keyserver keyserver.ubuntu.com –recv-keys 561F9B9CAC40B2F7

sudo nano /etc/apt/sources.list.d/passenger.list Add the following line to the passenger.list file

Change the book and the owner

Update APT

Finally, install passenger and nginx

This step will overwrite our Ruby version to the older version. To solve this problem, simply delete the incorrect Ruby location and create a new symbolic link to the correct Ruby binary:

Final

Chia sẻ bài viết ngay

Nguồn bài viết : Viblo