If you use Webrick you can implement a servlet and service http requests using ruby. Now I have code that does everything that I want but I would like to move to Apache. Is there a way to modify the .htaccess file to send all the requests through a ruby handler?
A:
you should check out phusion passenger. It lets you easily deploy any ruby Rack based web app in apache. You can then use rails, sinatra, waves, etc from apache.
jshen
2009-05-29 17:10:01
Looks like a great app, thanks for the suggestion! I'm actually more interested in the details - is there a way of using an Apache Handler, etc.
Daniel
2009-05-29 17:59:38
There is always a way, but you'd be swimming against the current.
jshen
2009-05-29 19:10:19
A:
You're asking for mod_ruby.
That was abandoned years ago in favor of running the Ruby code in a separate process under Mongrel, and just using Apache mod_proxy (or another web server acting as a proxy).
And now that Passenger is available lots of people (including myself) are adopting it instead of Mongrel, because it's simpler.
Just accept that you did it wrong the first time and bite the bullet. Rewrite your code as a Rack service, and run it via Passenger.
Jamie Flournoy
2009-05-31 22:47:23