If a man speaks in a forest, and his wife's not there, is he still wrong?

Ruby On Rails with Apache2

I quite fancy getting up to speed with Ruby On Rails as it looks like a very powerful web app development environment. I'll probably end up running this from lighttpd, but that's one learning curve too many so, for now, I decided to get it running on my Fedora Core 4 box running Apache 2.

Here's what I did. References:



# yum install ruby ruby-docs ruby-devel rdoc irb

Note: ruby-devel needed to build ruby gems later


# cd /usr/src/redhat/RPMS/i386
# wget ftp://ftp.wesmo.com/pub/redhat/i386/mod_fastcgi-2.4.2-1.i386.rpm

Note: SRPM also available: ftp://ftp.wesmo.com/pub/redhat/SRPMS/mod_fastcgi-2.4.2-1.src.rpm

# rpm -ivh mod_fastcgi-2.4.2-1.i386.rpm
# ls -l /etc/httpd/modules/mod_fastcgi.so
-rw-r--r-- 1 root root 339557 Jan 26 2004 /etc/httpd/modules/mod_fastcgi.so

All other modules are world-executable. Not sure if this is relevant, but just to be safe:

# chmod +x /etc/httpd/modules/mod_fastcgi.so
# ls -l /etc/httpd/modules/mod_fastcgi.so
-rwxr-xr-x 1 root root 339557 Jan 26 2004 /etc/httpd/modules/mod_fastcgi.so

# vi /etc/httpd/conf/httpd.conf

Add lines:

LoadModule fastcgi_module modules/mod_fastcgi.so
<IfModule mod_fastcgi.c>
FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi .fcg .fpl

Question: is ExecCGI required for FastCGI scripts as well as CGI?

Add rails.robinbowes.com to DNS

Add a new host for the rails test app

# vi /etc/httpd/conf.d/virtualhosts.conf

<VirtualHost *:80>
ServerName rails.robinbowes.com
ServerAdmin robin-rails@robinbowes.com
ErrorLog logs/rails.robinbowes.com-error_log
CustomLog logs/rails.robinbowes.com-access_log combined
DocumentRoot /home/apache/robinbowes.com/rails/live/public/
<Directory /home/apache/robinbowes.com/rails/live/public/>
Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny

# service httpd restart

Ruby Gems
- http://wiki.rubyonrails.com/rails/show/RubyGems

# cd /usr/local/src
# wget http://rubyforge.org/frs/download.php/3700/rubygems-0.8.10.tgz
# tar zxvf rubygems-0.8.10.tgz
# cd rubygems-0.8.10
# ruby setup.rb

- http://wiki.rubyonrails.com/rails/show/GemRails

# gem install rails

Create a test app

# cd /home/apache/robinbowes.com/rails
# rails test
# ln -s test live
# cd live
# chown -R apache:apache .
# vi public/dispatch.fcgi

Replace "require 'fcgi'" with:

require 'rubygems'
require_gem 'fcgi'

# vi /public/.htaccess

Change "RewriteRule ^(.*)$ dispatch.cgi [QSA,L]" to:

RewriteRule ^(.*)$ /dispatch.fcgi?$1 [QSA,L]

# chmod 755 public/dispatch.fcgi
# chmod 755 public/.htaccess

Check it out:


Yay, it works!

Story Options

Ruby On Rails with Apache2 | 0 comments
The following comments are owned by whomever posted them. This site is not responsible for what they say.


  • Home
  • Misc (6/0)
  • Audio (5/0)
  • Linux (21/0)
  • Family (1/0)
  • Fishing Diary (1/0)
  • OpenSolaris (7/0)
  • Computing (11/0)
  • General News (7/0)
  • Chloe (1/0)
  • Emily (2/0)
  • Twins (5/0)
  • Classifieds (2/0)
  • GeekLog (2/0)
  • Project Management (1/0)
  • User Functions

    Lost your password?