mod_ruby and Rails configuration files

A

Andrew Arnott

I walked through Curt Hibbs' tutorial
(http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html?page=1) for
Ruby on Rails and was very impressed. So far though, I've only gotten
my Rails web site running through WEBrick. I'd like to get it running
through Apache. I have mod_ruby installed, and Apache's configuration
files now get Apache to correctly handle *.rhtml pages through eRuby.
But I haven't been able to figure out the Apache configuration to get
my Rails cookbook/recipe app to run from within Apache.

Below is the configuration section relevant to the discussion. Can
anyone please tell me what I am doing wrong, and how I can get Rails
running through Apache? (I believe I'm running the latest ruby and
rails available--from Gentoo Portage)

Thanks in advance. Configuration follows.

LoadModule ruby_module ../apache2-extramodules/mod_ruby.so

# Ruby scripts (.rbx) support
<IfModule mod_ruby.c>
RubyRequire apache/ruby-run

# Execute *.rbx files as Ruby scripts
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
</IfModule>

# eRuby (.rhtml) support
<IfModule mod_ruby.c>
RubyRequire apache/eruby-run

# Handle *.rhtml files as eRuby files
<Files *.rhtml>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
</Files>
</IfModule>

Alias /cookbook "/home/ala55/rails/cookbook/public"
<Directory /home/ala55/rails/cookbook/public>
Order allow,deny
Allow from all

Options ExecCGI
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Directory>
 
D

David Heinemeier Hansson

Below is the configuration section relevant to the discussion. Can
anyone please tell me what I am doing wrong, and how I can get Rails
running through Apache? (I believe I'm running the latest ruby and
rails available--from Gentoo Portage)

You don't want to use mod_ruby. FastCGI is where its at. There's an
example Apache configuration in the README file and there's a
resource page for FastCGI on http://wiki.rubyonrails.com/rails/show/
FastCGI
 
A

Andrew Arnott

I'm following the directions on
http://wiki.rubyonrails.com/rails/show/HowtoInstallOnGentooWithApache,
which I found with Tobin's help. I'm shooting for FastCGI now, as a
result of David's recommendation.

I've following the installation instructions (I think), but I keep
getting the error below when I pull up
http://127.0.0.1/ala55/cookbook/recipe/list. I have a symlink set up,
and Options ExecCGI FollowSymLinks set also. I can navigate in the
file system to the very file Apache claims not to be able to find.
Permissions are 755 on all files in the public directory. Any ideas?

Not Found

The requested URL /home/ala55/public_html/cookbook/dispatch.fcgi was
not found on this server.
Apache/2.0.52 (Gentoo/Linux) mod_fastcgi/2.4.2 PHP/4.3.11
mod_mono/1.0.6.99 mod_ruby/1.2.4 Ruby/1.8.2(2004-12-25) Server at
fhssdev2.byu.edu Port 80
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,962
Messages
2,570,134
Members
46,692
Latest member
JenniferTi

Latest Threads

Top