Setting up a rails app in a relative path (using Apache and Passenger)

Hi,

This seems like it should be a common problem, but I haven’t been able to google for the right terms, evidently…

I’m trying to set up my rails app, not to the base domain name, but to a relative path. That is, the server already hosts an app at the domain, and I want to add a rails app.

So, mydomain.com already exists and is a PHP app. I want mydomain.com/rails to point to my rails app.

It looks like this case was handled in Rails 2 with relative_url_root, but that was deprecated a long time ago. What is the standard way to do this now?

TIA,

Paul

This seems like it should be a common problem, but I haven't been able to google for the right terms, evidently...

It is.

I'm trying to set up my rails app, not to the base domain name, but to a relative path. That is, the server already hosts an app at the domain, and I want to add a rails app.

So, mydomain.com already exists and is a PHP app. I want mydomain.com/rails to point to my rails app.

It looks like this case was handled in Rails 2 with relative_url_root, but that was deprecated a long time ago. What is the standard way to do this now?

My opinion is that you should not put apps underneath other app's directories. This can cause some significant problems.

My suggestion is to use a subdomain like rails.mydomain.com instead, and set up your server to serve up the rails app from a different directory structure than (www.)mydomain.com.

However, if you do go the subdirectory way, you need configure your server to drive your rails app from that path.

You can use passenger with either method under either apache or nginx.