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

43 views
Skip to first unread message

Paul

unread,
Jun 14, 2013, 2:53:20 PM6/14/13
to rubyonrails-talk
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

Tamara Temple

unread,
Jun 17, 2013, 11:21:40 PM6/17/13
to rubyonra...@googlegroups.com
Paul <pa...@nines.org> wrote:
> 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.
Reply all
Reply to author
Forward
0 new messages