Before an application can make it onto the Internet, it needs to go into a production environment and be deployed. This multi-part article series will show you how to do this for the Ruby-on-Rails ecommerce application we've been working on. It is excerpted from chapter 12 of the book Practical Rails Projects, written by Eldon Alameda (Apress; ISBN: 1590597818).
In this chapter, we’ll show you how to set up an application’s production environment, including the LightTPD web server and FastCGI extension. Then we will walk through the manual deployment process. Finally, we’ll demonstrate how to simplify deployment tasks with Capistrano, a tool specifically designed to automate the deployment of Ruby on Rails applications.
Setting Up the Production Environment
George has bought a new Intel-powered server running Ubuntu Linux, to which we will deploy LightTPD (web server), Ruby on Rails and FastCGI (application server), and MySQL (database server). The high-level system architecture of the Emporium production environment is shown in Figure 12-1.
Although we talk about three different servers, the production environment consists of only one physical machine, since that is all we need to start. Later, we can support more traffic if the need arises by scaling horizontally (adding more machines) or vertically (adding more processing power).