Installing the Database for Application Deployment
In this second part of a multi-part article series, you'll learn how to install various parts of an application in preparation for deploying it online. This article is excerpted from chapter 12 of the book Practical Rails Projects, written by Eldon Alameda (Apress; ISBN: 1590597818).
Installing the Database for Application Deployment (Page 1 of 4 )
Installing the Database Server (MySQL)
In the case of Emporium, the database server is running a single instance of MySQL (http://www.mysql.com). MySQL is claimed to be the world’s most popular open source database. It is a safe choice that is used by many high-traffic websites, including craigslist.com, which serves millions of classified ads a day from a MySQL cluster.
The communication between Ruby on Rails and the database is done through a native MySQL database driver.
You need to install MySQL and the MySQL driver (native) on the production server. We explained how to install these in Chapter 1.
Configuring LightTPD
Configuring LightTPD is straightforward. You can use the template (doc/lighttpd.conf) that is distributed along with the source and customize it to meet your needs.
The configuration file for Emporium’s production environment is shown in Listing 12-1. Save this configuration in$EMPORIUM_PATH/config/lighttpd_production.conf, where$EMPORIUM_PATHis the path to your application.
The syntax of the configuration file uses the following format:
option = value
Options are usually grouped into modules, such asserver.portandaccesslog.filename. Supported value formats include strings, integers, booleans, arrays, and others.