Setting up Apache2 and passenger for Ruby 2.0.0 is actually pretty simple. As of right now, for Passenger to work with Apache2 and Ruby 2.0.0 you will need to install Passenger 4 RC4 or above, which currently isn’t (technically) a stable release. I have found it’s pretty stable though.
Install passenger through RubyGems
First, install passenger through gems:
gem install passenger --pre
RVM or Ruby Verion Management is a library written for managing multiple version of Ruby on a single machine, and even for a single user. Using this set of libraries you can easily install a version of Ruby and switch between different version as and when you see fit. This is great for developers, especially those having to maintain multiple different applications, using different Ruby and potentially rails versions.
Installation of RVM on Ubuntu 12.04 for a single user
To start, download RVM and automatically install the latest stable version of Ruby
curl -L https://get.rvm.io | bash -s stable --ruby
Here we download a file which has a series of commands for installing RVM and the latest stable version of Ruby. `-s` tells bash to read commands from the standard input, which is the downloaded file from the rvm website. This process will take a while, depending on your connection speed and processors as it downloads and compiles Ruby and Rubygems. Continue reading
God is a very powerful process monitoring library written in Ruby. This tutorial describes how to setup a basic monitoring configuration file for a NodeJS application, telling God to restart the NodeJS app upon the process being killed (for what ever reason).
To get started, create a god/ directory within your Node app.
In this directory, create a god configuration file
Update the global God configuration file (Refer to previous tutorial on installing God on Ubuntu 12.04) with the location of your Node app config.
Great, when you reload God it will start using the configuration, but first we must write the configuration file. Open your nodeapp.god config file for editing. We will start off by creating a basic configuration file that will allow you to:
- Start node
- Stop node
- Restart node
God, a monitoring framework written in Ruby is easy to configure, easy to extend and easy to use. God allows you to monitor the state of a process (whether it is running or not) and perform specific tasks dependent upon the state. These tasks can be as simple as restarting the process or go as far as alerting you via email, text, a phone call – basically, anything you can programmatically do in Ruby.
This tutorial shows you how to setup God on Ubuntu 12.04 (and I’m pretty sure it would work for earlier versions of Ubuntu too). I will cover the installation and layout of configuration files, as well as setting up an init service script allowing for God to be started|stopped|restarted easily, and automatically started at boot. Continue reading