# Multiple rails applications under one domain

**URL:** <https://www.ruby-forum.com/t/multiple-rails-applications-under-one-domain/77246>\
**Category:** Rails\
**Created:** [November 25, 2006, 2:38pm UTC](https://www.ruby-forum.com/t/multiple-rails-applications-under-one-domain/77246 "2006-11-25T14:38:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![wooki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ecccb3/32.png) [@wooki](https://www.ruby-forum.com/u/wooki)\
**Post date:** [November 25, 2006, 2:38pm UTC](https://www.ruby-forum.com/t/multiple-rails-applications-under-one-domain/77246/1 "2006-11-25T14:38:47Z")

</div>

I have recently bought rails hosting and installed my first rails app,  
brilliant framework!

I have another application in the pipeline as well as a number of legacy  
PHP applications which I wish to move to the same host - in the long run  
I would transfer the old domain across but not until I have the legacy  
code up and running.

The problem is this - how do I add old PHP code, and perhaps a second  
rails application, within another rails app?

At present I am hosted on [primehosting.co.uk](http://primehosting.co.uk) and my domain points to a  
www folder (a link to my rails apps public folder). I added another  
link inside my apps public folder that linked ot the public folder of my  
second rails app but of course all of the requests are still processed  
by the 1st rails app.

Any ideas or help is VERY welcome!

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![wooki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ecccb3/32.png) [@wooki](https://www.ruby-forum.com/u/wooki)\
**Post date:** [November 25, 2006, 4:07pm UTC](https://www.ruby-forum.com/t/multiple-rails-applications-under-one-domain/77246/2 "2006-11-25T16:07:12Z")

</div>

Jim Rowe wrote:

> 

Jim, if you have other rail app, you can add a subdomain  
[rails2app.example.com](http://rails2app.example.com). That would create ‘rails2app’ folder in your  
public\_html. Delete this folder and create symlink to your 2nd rails app  
instead.

something like  
ln -s ~/apps/rails2app/current/public/ ~/public\_html/rails2app

## hope these helps, Bojan

Bojan M.  
Informatika Mihelac, Bojan M. s.p. | [www.informatikamihelac.com](http://www.informatikamihelac.com)  
 → tools, scripts, tricks from our code lab: [http://source.mihelac.org](http://source.mihelac.org)

---

<div class="post-metadata">

**Author:** ![wooki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ecccb3/32.png) [@wooki](https://www.ruby-forum.com/u/wooki)\
**Post date:** [November 25, 2006, 8:08pm UTC](https://www.ruby-forum.com/t/multiple-rails-applications-under-one-domain/77246/3 "2006-11-25T20:08:56Z")

</div>

Hi Bojan,

Thanks for reply.

Problem is my ~/public\_html is already a symlink direct to my current  
apps public folder. I have been trying to create a real public\_html  
folder with symlinks to my two apps, I would need default requests to go  
to appOne, and requests to a specific subfolder to go to appTwo. Have  
tried working it out from some example but have got nowhere.

Anything you think might be useful would be good to read!

Thanks

---

<div class="post-metadata">

**Author:** ![wooki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ecccb3/32.png) [@wooki](https://www.ruby-forum.com/u/wooki)\
**Post date:** [November 26, 2006, 5:02pm UTC](https://www.ruby-forum.com/t/multiple-rails-applications-under-one-domain/77246/4 "2006-11-26T17:02:57Z")

</div>

Jim Rowe wrote:

> Anything you think might be useful would be good to read!
> 
> Thanks

I think it shouldn’t be problem if public\_html is already a symlink, I  
have similiar configuration. These is how it directories looks in my  
case (typo is main website and dev is subdomain):

ls -l  
public\_html → /home/sossi/apps/typo/public  
ls -l public\_html  
dev → /home/sossi/apps/mojgost/current/public/

best,  
Bojan

–  
Bojan M.  
Informatika Mihelac, Bojan M. s.p. | [www.informatikamihelac.com](http://www.informatikamihelac.com)  
 → tools, scripts, tricks from our code lab: [http://source.mihelac.org](http://source.mihelac.org)
