# PP + Multiple rails apps

**URL:** <https://www.ruby-forum.com/t/pp-multiple-rails-apps/168486>\
**Category:** Rails\
**Created:** [May 21, 2009, 12:08pm UTC](https://www.ruby-forum.com/t/pp-multiple-rails-apps/168486 "2009-05-21T12:08:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![p\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a6a055/32.png) [@p\_W](https://www.ruby-forum.com/u/p_W)\
**Post date:** [May 21, 2009, 12:08pm UTC](https://www.ruby-forum.com/t/pp-multiple-rails-apps/168486/1 "2009-05-21T12:08:41Z")

</div>

I am a RoR beginner and thought I’d give it a try by using rails to  
write some ‘in-house’ apps…for my house. I have a webserver in my  
apt. that I just run as a kind of ‘intranet’ and have apps on it that  
help us with house-hold things.

My question is whether I can run multiple rails apps on Phusion  
Passenger without having to set up different subdomains for each  
one…if so, where is the document root? The top level app directory?  
The public folder?

---

<div class="post-metadata">

**Author:** ![p\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a6a055/32.png) [@p\_W](https://www.ruby-forum.com/u/p_W)\
**Post date:** [May 21, 2009, 3:38pm UTC](https://www.ruby-forum.com/t/pp-multiple-rails-apps/168486/2 "2009-05-21T15:38:17Z")

</div>

You can easily setup as many apps as u want, u can do this by  
configuring your apache server with virtual hosts in you apache server  
config file and add the relevent host names in your hosts config file.

cheers

---

<div class="post-metadata">

**Author:** ![p\_W](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a6a055/32.png) [@p\_W](https://www.ruby-forum.com/u/p_W)\
**Post date:** [May 21, 2009, 3:50pm UTC](https://www.ruby-forum.com/t/pp-multiple-rails-apps/168486/3 "2009-05-21T15:50:01Z")

</div>

Quoting p\_W [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> I am a RoR beginner and thought I’d give it a try by using rails to  
> write some ‘in-house’ apps…for my house. I have a webserver in my  
> apt. that I just run as a kind of ‘intranet’ and have apps on it that  
> help us with house-hold things.
> 
> My question is whether I can run multiple rails apps on Phusion  
> Passenger without having to set up different subdomains for each  
> one…if so, where is the document root? The top level app directory?  
> The public folder?

You can use name based virtual hosts with Apache and Phusion Passenger.  
The  
details are explained at the URL below. Unfortunately, the author  
didn’t  
proof his/her work by looking at the blog and the HTML isn’t proper  
escaped or  
unescaped. E.g. displays

`NameVirtualHost *
<VirtualHost *:80>
DocumentRoot /Users/wynn/projects/mindbites/public`

`
should read
<VirtualHost *:80>
DocumentRoot /Users/wynn/projects/mindbites/public
with the CSS style ‘apache’ applied. But once you decipher the mix, it
is
helpful. I have two home-grown Rails apps (Amethyst and TagFlow) and
Nagios
(a system monitoring app) running on the same Apache server. The URLs
are:
http://amethyst.local/
http://tagflow.local/
http://127.0.0.1/nagios
The /etc/hosts file contains:
127.0.0.1 tagflow.local
127.0.0.1 amethyst.local
HTTP 1.1 can handle different domains that resolve to the same IP
address and
treat them as separate sites.
HTH,
Jeffrey
The URL:
> **[Locomotivation.com is for sale | HugeDomains](https://www.hugedomains.com/domain_profile.cfm?d=locomotivation.com)**
>
> Extensive selection of high-quality domain names. Knowledgeable, friendly customer support.
`
