You can use Ruby to write CGI programs for the Web, but, as with most
CGI programs, the default configuration has to start up a new copy of
Ruby with every cgi-bin page access.
That's expensive in terms of
machine utilization and can be painfully slow for Web surfers.
The Apache Web server solves this problem by allowing loadable
modules.
Typically, these modules are dynamically loaded and become part of the
running Web server process---there is no need to spawn
another interpreter over and over again to service requests; the Web
server
is the interpreter.
And so we come to
mod_ruby
(available from the archives), an
Apache module that links a full Ruby interpreter into the Apache Web
server itself. The
README
file included with
mod_ruby
provides
details on how to compile and install it.
Once installed and configured, you can run Ruby scripts just like you
could without
mod_ruby
, except that now they will come up much
faster.