D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

[LUG] Install RoR - Apache2 and FastCGI

 

Hi,

I've installed RoR on Debian Sarge last night and it worked well using WEBrick.
I created my first application: addressbook.

Tonight's step was to make it work using Apache2 and fastCGI.
I followed several guides online but got stuck. I will try to detail everything I ended up doing:

i installed libfcgi-ruby1.8 and libapache2-mod-fcgi and I enabled mod rewrite.
I added the following lines in my sites-enabled file:

        Alias /addressbook "/var/www/addressbook/public"
        <Directory "/var/www/addressbook/public">
                Options ExecCGI FollowSymLinks
                AddHandler cgi-script .cgi
                AllowOverride all
                Order allow,deny
                Allow from all
        </Directory>


I also modified the following lines in the .htaccess in addressbook/public

RewriteBase /addressbook
#RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

I restarted apache a number of times and had no success...

When I go to localhost/addressbook I see the following:


#!/usr/bin/ruby1.8
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
# and the number of requests to process before running garbage collection.
#
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
# and the GC period is nil (turned off). A reasonable number of requests
# could range from 10-100 depending on the memory footprint of your app.
#
# Example:
# # Default log path, normal GC behavior.
# RailsFCGIHandler.process!
#
# # Default log path, 50 requests between GC.
# RailsFCGIHandler.process! nil, 50
#
# # Custom log path, normal GC behavior.
# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
#
require File.dirname(__FILE__) + "/../config/environment"
require 'fcgi_handler'

RailsFCGIHandler.process!




I hope someone knows what I missed here to get this going :)
thanks

Sam
-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html