Accessing multiple rails apps from inside network

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
(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

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
(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
192.168.1.69 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

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
[email protected]

On Sep 15, 2008, at 1:57 PM, Frederick C.
<[email protected]

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.

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:

Check it out.

Hope this helps,
Neal