Preparation and Installation

Before we get going with Ruby and CGI, we’ve got to do a little work to get our webserver ready. For the purposes of this chapter, I’ll be focusing on getting CGI working for the Apache webserver running on a Unix-like environment. Apache is the most popular webserver, and Unix-like operating systems are the most common (and most stable) server operating systems.

You can get a copy of the Apache webserver at http://httpd.apache.org, or you can use a package manager to install it. (Mac OS X comes with Apache pre-installed.) I used apt-get on my Ubuntu system, as follows:

apt-get install apache2 apache2-doc Reading package lists... Done Building dependency tree... Done The following extra packages will be installed: apache2-common ...

Get Ruby by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.