[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Apache with Ruby

Henry Ortega

4/3/2006 12:54:00 AM

I am really new to Ruby. I have just installed Ruby on my Linux box and it
works fine. I need Apache to recognize Ruby scripts and interpret them. Is
mod_ruby the only way to do it?
6 Answers

Logan Capaldo

4/3/2006 1:03:00 AM

0


On Apr 2, 2006, at 8:54 PM, Henry Ortega wrote:

> I am really new to Ruby. I have just installed Ruby on my Linux box
> and it
> works fine. I need Apache to recognize Ruby scripts and interpret
> them. Is
> mod_ruby the only way to do it?

You can of course use the regular CGI methods. I.e. start your files
with
#!/path/to/ruby
... script ...

And configure apache to recognize them as cgis (makr them as
executable, put them in cgi-bin or use httpd.conf or .htaccess to
configure apache to recognize .rb files as cgis)



David Vallner

4/4/2006 8:32:00 PM

0

Dna Pondelok 03 Apríl 2006 03:03 Logan Capaldo napísal:
> On Apr 2, 2006, at 8:54 PM, Henry Ortega wrote:
> > I am really new to Ruby. I have just installed Ruby on my Linux box
> > and it
> > works fine. I need Apache to recognize Ruby scripts and interpret
> > them. Is
> > mod_ruby the only way to do it?
>
> You can of course use the regular CGI methods. I.e. start your files
> with
> #!/path/to/ruby
> ... script ...
>
> And configure apache to recognize them as cgis (makr them as
> executable, put them in cgi-bin or use httpd.conf or .htaccess to
> configure apache to recognize .rb files as cgis)

I'd use mod_fastcgi instead of mod_ruby if you want to avoid the CGI overhead.

David Vallner


john_sips_tea

4/4/2006 9:34:00 PM

0

> I'd use mod_fastcgi instead of mod_ruby if you want to avoid the
> CGI overhead.

Maybe you mis-worded that. Of course, the whole point of using
mod_ruby is to avoid the overhead of using plain old CGI. :)

john_sips_tea

4/4/2006 9:35:00 PM

0

Whoops. Sorry -- I see what you were saying now.

john_sips_tea

4/4/2006 9:36:00 PM

0

Just curious David, why choose mod_fastcgi over mod_ruby?

Daniel Baird

4/5/2006 3:43:00 AM

0

On 05/04/06, john_sips_tea@yahoo.com <john_sips_tea@yahoo.com> wrote:
>
> Just curious David, why choose mod_fastcgi over mod_ruby?



afaik:

mod_ruby lives in every instance of the server -- so if you have five apache
processes serving ruby stuff, and five processes serving static content, you
have the ruby interpreter loaded into memory ten times over.

fast cgi gives you the benefit of a long running ruby interpreter (ie unlike
normal cgi, where the ruby interp has to start up fresh for every request),
but still keeps ruby out of the apache footprint, so the Apache process that
is serving your fav_icon doesn't pay the ruby memory tax.

that's my impression at least -- but I have been humbled in these forums
before, and probably will be again :)

;Daniel


--
Daniel Baird
http://danie... (TiddlyW;nks! :: Whiteboard Koala :: Blog :: Things
That Suck)
[[My webhost uptime is ~ 92%.. if no answer pls call again later!]]