# Multiple rails apps on a single host with mod\_rails

**URL:** <https://www.ruby-forum.com/t/multiple-rails-apps-on-a-single-host-with-mod-rails/135749>\
**Category:** Rails\
**Created:** [April 24, 2008, 4:41pm UTC](https://www.ruby-forum.com/t/multiple-rails-apps-on-a-single-host-with-mod-rails/135749 "2008-04-24T16:41:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mick\_Staugaard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/db5fbb/32.png) [@Mick\_Staugaard](https://www.ruby-forum.com/u/Mick_Staugaard)\
**Post date:** [April 24, 2008, 4:41pm UTC](https://www.ruby-forum.com/t/multiple-rails-apps-on-a-single-host-with-mod-rails/135749/1 "2008-04-24T16:41:19Z")

</div>

Hi

I’m playing around with setting up a server to host multiple rails  
applications on a single hostname.

The documentation only explains how to do it using multiple virtual  
hosts and i can not figure out if it is even possible.

Have you played around with a setup like this?

Mick

---

<div class="post-metadata">

**Author:** ![Mick\_Staugaard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/db5fbb/32.png) [@Mick\_Staugaard](https://www.ruby-forum.com/u/Mick_Staugaard)\
**Post date:** [April 25, 2008, 2:15am UTC](https://www.ruby-forum.com/t/multiple-rails-apps-on-a-single-host-with-mod-rails/135749/2 "2008-04-25T02:15:32Z")

</div>

Mick, I haven’t, but there’s no reason you couldn’t set rewrite rules  
so that this works… i.e. something like:

[www.foo.com/one/](http://www.foo.com/one/) =\> application one  
[www.foo.com/two/](http://www.foo.com/two/) =\> application two

But you can’t have “[www.foo.com](http://www.foo.com)” go to multiple applications, because  
how would it know which one to use? (well, ok, you could do some fancy  
stuff like incoming IP filtering, but I suspect this isn’t what you  
are talking about).

Read up about mod\_rewrite in apache. In fact, I’ve seen some other  
posts in the past where someone was setting up apache to do the  
equivalent of “[www.foo.com/one/](http://www.foo.com/one/)” =\> some rails app. So it shouldn’t be  
too hard to extend that so that you can have multiple apps. Or maybe  
you use proxy rules to proxy from apache to mongrel.

Just some thoughts…

-Danimal
