Ruby on Rails Deployment
Introduction
Ruby on Rails is a wonderful platform for web applications and rapid web development. That being said when running an application using the ruby interpreter as well as the plethora of deployment options one can get confused quite quickly. I am writing this post to try and clear the muddy water of deploying Ruby on Rails web applications.
Platform Choices
Disclaimer: None of the recommendations below are tested for the Win 32 platform and there is a high probability that nothing will work correctly or at all.
All of the following deployment recommendations I will be writing about are achievable on most if not all of the UNIX/Linux/BSD operating systems that are available today. Now that we have those very important logistics out of the way lets get started with the foundation for rails deployment!
Note: Mac OS X Leopard (The next release slated for October) will ship with the Ruby on Rails stack already installed and ready to start development.
If you are running Mac OS X Tiger then head over to my Mac OS X Ruby on Rails setup How-To to get yourself up and running with an optimized server-grade Ruby on Rails installation.
Don't be too thrown off by that title because it can be used on any UNIX/BSD Operating System. Just switch up to a source based installation or use the package manager built into your OS.
Foundation
I have two recommendations for optimized Ruby on Rails hosting. I will go over the benefits of each and when to choose one over the other. Both options require an external listening web server and a process to access the Ruby on Rails web application.
Installing FreeBSD 6.2 using PXEBoot/TFTP/NFS
Introduction
So what do you do when you do not have an optical drive for a computer or server and you would like to install FreeBSD? You have two options, use a USB device (CD-ROM, Hard Drive, or Thumbdrive) or PXE booting and doing a full network install. This article will discuss the latter. Doing a PXE boot install is a bit convoluded with FreeBSD, so I will go through all the steps involved from setting up the TFTP, NFS, and DHCP to the three times you need to run sysinstall.
Requirements
- A network adapter that supports PXE booting.
- A spare computer or server to install a TFTP, NFS, and DHCP server on.
- CD1 of the latest version of FreeBSD for your system's architechture.
Note: The following setup for the DHCP, NFS, and TFTP server is done on FreeBSD. Using a different OS may have a slightly different configuration, but generally should be similar.
Tip of the Day - Live Remounting of Filesystems
If you need to remount a in-use filesystem like / or /usr without rebooting the operating system, use the mount command with the -o remount option.
To remount the root partition using settings found in /etc/fstab.conf run:
mount -o remount /
This is handy if a filesystem has been mounted read only during a recovery process. For example to remount the root partition read/write do:
mount -o remount,rw /
If there is no /etc/fstab entry for the root partition (or any partition you are using) you may need to specify the root partition (/dev/sda1 in this example):
mount -o remount,rw /dev/sda1 /
FreeBSD 6.2 Minimal Pictorial Install Guide
Introduction
This guide details the install of FreeBSD 6.2 with a minimalist approach. This allows for less software to update in the future, and less software that has the potential to have security holes. I have added screen shots for almost ever single screen you will see during the install. Enjoy.