Saturday, December 8, 2018

Installing ruby on rails with Apache on Ubuntu 16.04 LTS for production

Recently I decided to start with ROR and move away from PHP.
So I decided to first setup production like environment for rails.
And to my surprise it wasnt the easy task to do, at least for me.
hence decided to blog about same and share.

Have taken heavy reference from two sites, and those are as given below.
  1. https://gorails.com/setup/ubuntu/16.04
  2. https://stackoverflow.com/questions/33573972/run-rails-application-with-apache-and-passenger-on-ubuntu/44920822#44920822
Was planning to go with latest rails but after lots and lots of try, was not able to resolve few of the permission issues. That is when one of my colleague suggested me to start with some old version.

Below are the version details:
Operating system: Ubuntu 16.04.5 LTS
Ruby: ruby 2.5.3
Rails: Rails 5.0.7.1
Passenger: Phusion Passenger 5.3.7

Note: first try below procedure on your dev, UAT or day-1 environment, do not follow it directly on production.

Let's start with installation process.

Wednesday, November 21, 2018

Vagrant with Hyper-V

So by default when we think about Vagrant, we think virtual-box as default backend.
But if you are on windows 10 and using Hyper-V for some reason e.g. docker, it dosent really make any sense to disable Hyper-V and install Virtual box.
Rather you should just use Vagrant with Hyper-V.

Its really straight and simple, your vagrant up command will directly identify if you have Virtual box or Hyper-V as a provider and automatically spin up your box using that provider.

But there is a catch, which ever box image you are using should support provider Hyper-V.

Otherwise you will see error like below.









This is it for this post.

Saturday, November 17, 2018

Start using Vagrant, now! - Part 2

So here we saw how to setup vagrant on your machine.
And now we will cover how to setup Ubuntu 18.04 as Vagrant box.


Getting it up is relatively easy, if you have basic knowledge of Linux.
Before we start with above, we will need one Linux console emulator. There are quite a few to choose from. But personally I use git command line tool. Other options are cmderconemu

Once you are ready with command line tool, create one folder to start with your vagrant boxes.
Generally what I follow is create one directory "vagrant boxes" in drive where I have most free space.
And under that folder, I create folder per box. e.g. lamp, es, etc.

Considering now you have everything in place. 
Let's start with installing Ubuntu 18.04.

Saturday, November 10, 2018

Start using Vagrant, now!

Hi there,
If you are a web developer, and your terminal is Windows machine.
I am sure you must have faced many hurdles in your development tasks, as most of web hosting servers are Linux based. And doing development on windows, testing deploying on Linux may raise bugs due to environmental differences.

So its best to have development environment, similar to your UAT and Prod environment.

This leaves you with several options.

  1. Get hosted linux server - good option but price can be issue for some of us.
  2. Get a separate machine to run linux and use it as dev env.
  3. Install VM ware, Virtual box and manually manage VMs on your windows terminal.
  4. Use Vagrant.
So we will jump directly to option number 4, i.e. using Vagrant.

Installing ruby on rails with Apache on Ubuntu 16.04 LTS for production

Recently I decided to start with ROR and move away from PHP. So I decided to first setup production like environment for rails. And to my...