# Accessing multiple rails apps from inside network

**URL:** <https://www.ruby-forum.com/t/accessing-multiple-rails-apps-from-inside-network/148626>\
**Category:** Rails\
**Created:** [September 15, 2008, 6:47pm UTC](https://www.ruby-forum.com/t/accessing-multiple-rails-apps-from-inside-network/148626 "2008-09-15T18:47:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmcelhany](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a88e57/32.png) [@bmcelhany](https://www.ruby-forum.com/u/bmcelhany)\
**Post date:** [September 15, 2008, 6:47pm UTC](https://www.ruby-forum.com/t/accessing-multiple-rails-apps-from-inside-network/148626/1 "2008-09-15T18:47:59Z")

</div>

Hi all,

I’m not sure if this is the right forum for this question, but here  
goes:

I have a web server at home (Apache2, Ubuntu) that is running two  
Rails apps. Each app is forwarded to a Mongrel cluster (app1 uses  
ports 8000 to 8003 and app2 uses ports 9000 to 9003). I have a domain  
pointing to app1 and a sub-domain pointing to app2 and everything  
works perfectly from OUTSIDE my local network.

My problem is that my router (I’m on AT&T’s U-Verse) will not allow me  
to make calls to my web server using the public IP address or either  
one of the domain names (not exactly sure why, but apparently this is  
a known issue). What I need to be able to do is run either one of  
these sites from inside my network. If I go to [http://192.168.1.69](http://192.168.1.69)  
(the internal IP of my web server) I get the app1 (default) site which  
is just fine. How do I get to app2 though?

I know this is more of an Apache-specific question, but I thought that  
since I was dealing with a Rails/Mongrel setup, this might be a good  
place to start. Any ideas?

Thanks!

-Brian

---

<div class="post-metadata">

**Author:** ![bmcelhany](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a88e57/32.png) [@bmcelhany](https://www.ruby-forum.com/u/bmcelhany)\
**Post date:** [September 15, 2008, 7:57pm UTC](https://www.ruby-forum.com/t/accessing-multiple-rails-apps-from-inside-network/148626/2 "2008-09-15T19:57:51Z")

</div>

On 15 Sep 2008, at 17:47, bmcelhany wrote:

> works perfectly from OUTSIDE my local network.
> 
> My problem is that my router (I’m on AT&T’s U-Verse) will not allow me  
> to make calls to my web server using the public IP address or either  
> one of the domain names (not exactly sure why, but apparently this is  
> a known issue).

Yeah, some routers don’t do that.

> What I need to be able to do is run either one of  
> these sites from inside my network. If I go to [http://192.168.1.69](http://192.168.1.69)  
> (the internal IP of my web server) I get the app1 (default) site which  
> is just fine. How do I get to app2 though?

you could add entries to your /etc/hosts pointing all of the  
appropriate subdomains to 192.168.1.69. eg

192.168.1.69 [www.example.com](http://www.example.com)  
192.168.1.69 [other.example.com](http://other.example.com)

or you might find it neater to separate this out

192.168.1.69 www.example.local  
192.168.1.69 other.example.local

and then point your browser at www.example.local (you’d have to add  
www.example.local  
, other.example.local as server aliases in the appropriate VirtualHost  
entries.

Fred

---

<div class="post-metadata">

**Author:** ![bmcelhany](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a88e57/32.png) [@bmcelhany](https://www.ruby-forum.com/u/bmcelhany)\
**Post date:** [September 15, 2008, 9:03pm UTC](https://www.ruby-forum.com/t/accessing-multiple-rails-apps-from-inside-network/148626/3 "2008-09-15T21:03:46Z")

</div>

Another option would be to run a split-horizon DNS server internally  
that will hand out internal ips to internal clients and external ips  
to external clients. Look at tinydns / dnscache for a decent solution.

Cheers,  
Darrik

–  
Darrik Mazey  
DMT Programming, LLC.  
Office: 330.983.9941  
Mobile: 330.808.2025  
removed\_email\_address@domain.invalid

On Sep 15, 2008, at 1:57 PM, Frederick C.  
\<removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![bmcelhany](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a88e57/32.png) [@bmcelhany](https://www.ruby-forum.com/u/bmcelhany)\
**Post date:** [September 15, 2008, 10:04pm UTC](https://www.ruby-forum.com/t/accessing-multiple-rails-apps-from-inside-network/148626/4 "2008-09-15T22:04:18Z")

</div>

Thanks for everyone’s response! This is exactly what I was looking  
for…I’ll look into the various solutions and see what makes the most  
sense to my situation.

---

<div class="post-metadata">

**Author:** ![bmcelhany](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/a88e57/32.png) [@bmcelhany](https://www.ruby-forum.com/u/bmcelhany)\
**Post date:** [September 15, 2008, 9:19pm UTC](https://www.ruby-forum.com/t/accessing-multiple-rails-apps-from-inside-network/148626/5 "2008-09-15T21:19:38Z")

</div>

There’s a better approach here than working with routers and so  
forth. Have you checked out Phusion Passenger – it makes stuff like  
this really easy without having to mess around with DNS settings.  
Railscasts did a screencast on it at:

> **[\#122 Passenger in Development - RailsCasts](http://railscasts.com/episodes/122-passenger-in-development)**
>
> Short Ruby on Rails screencasts containing tips, tricks and tutorials. Great for both novice and experienced web developers.

Check it out.

Hope this helps,  
Neal
