Apache with Ruby

H

Henry Ortega

------=_Part_35828_25201084.1144025662674
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

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?

------=_Part_35828_25201084.1144025662674--
 
L

Logan Capaldo

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)
 
D

David Vallner

D=C5=88a Pondelok 03 Apr=C3=ADl 2006 03:03 Logan Capaldo nap=C3=ADsal:
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 overhe=
ad.

David Vallner
 
J

john_sips_tea

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. :)
 
D

Daniel Baird

------=_Part_27873_29415690.1144208594766
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

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 apach=
e
processes serving ruby stuff, and five processes serving static content, yo=
u
have the ruby interpreter loaded into memory ten times over.

fast cgi gives you the benefit of a long running ruby interpreter (ie unlik=
e
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 tha=
t
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://danielbaird.com (TiddlyW;nks! :: Whiteboard Koala :: Blog :: Things
That Suck)
[[My webhost uptime is ~ 92%.. if no answer pls call again later!]]

------=_Part_27873_29415690.1144208594766--
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top