views:

494

answers:

4

We have a RedHat box with Apache2, PHP5 and MySQL 5 for much of our development. Now, we have a Rails client, and we need to set up a Rails app on the same server. Can we install Ruby and the Rails framework with the same Apache, or should we avoid this? Why or Why not? Is it possible to direct subdomains to either PHP or Ruby in the individual V-host definitions?

+3  A: 

Yes, you can configure your virtual hosts to Rails, PHP, or anything else with the proper configuration. The details depend largely on how you are connecting to Rails, but generally however you would configure a single purpose Apache server should work for the virtual hosts.

sock
Great. Now can you tell me how to do it?
Sam McAfee
+7  A: 

You absolutely can run Rails apps behind an Apache web server. Check out Passenger, an easy to use Apache module with advanced features to run Rails (and other Ruby-based) web applications.

And yes, you just set up a virtual host for your Rails app. Check out These 2 posts if you need help doing this: part one and part two.

webmat
+2  A: 

Yeah - Install passenger, then you can configure your sites through your apache conf files. The passenger docs contain everything you'll need to know!

Mr. Matt
A: 

case study-kinda thing:

http://work.rowanhick.com/2007/06/08/franken-php-rails-apache-stein/

Gene T