LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-30-2004, 09:13 PM   #1
helot
LQ Newbie
 
Registered: Dec 2004
Location: Chicago, USA
Posts: 3

Rep: Reputation: 0
forwarding url to local IP


I have RH 9.0 with apache running virtual servers for three different domain names, but I would like to forward one of the domain URLs to another machine, also running apache, sitting on local ip (192.168.1.X).
Is there a way to selectively forward a URL to a local IP without redirecting the other two ?
I would like to keep the two other domains directed to the main box with the outside IP (64.81.XXX.XXX).

Here is my setup:

Box 1 - lan1 - Public IP: 64.81.XXX.XXX w/ NAT w/Apache
- lan2 - Local IP: 192.168.1.1
Box 2 - lan1 - Local IP: 192.168.1.2 w/Apache

I am still a newbie to networking. Any suggestion will help. Thanks.
 
Old 01-01-2005, 03:00 AM   #2
louis_m_c
LQ Newbie
 
Registered: Dec 2004
Location: Saint-Hubert, Canada
Posts: 26

Rep: Reputation: 15
if it's only for intranet purpose, you could use different domain names and
install a DNS server. Otherwhise, just use a redirector page on the main server. Let say, a blank page with only the javascript needed to forward the user to the other place. Another think I'm think of is if you use different ports than 80 for www you could use Nat tables from Iptables to redirect by example every traffic going to port 81 is redirected to ip 192.168.1.4.

2 dns how-to:
http://www.siliconvalleyccie.com/lin...dns-static.htm (Configuring DNS How-to)
DNS HowTo by Nicolai Langfeldt (the best but I don't have the link)
 
Old 01-01-2005, 03:31 PM   #3
helot
LQ Newbie
 
Registered: Dec 2004
Location: Chicago, USA
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks, that sounds like a good idea. So, you are suggesting that i could do a javascript that would forward the link something like this?:

http://www.mydomain1.com:81
http://www.mydomain2.com:80
http://www.mydomain3.com:80

Is there a way in Apache to set this up, something like a proxy or something?
How do subdomains work? Lets say if i would like to redirect page to
box1.mydomain1.com
box2.mydomain2.com, etc...
Is this done through local DNS or can i do it on the nameserver from my ISP?

Thanks, dns and nat still confuse me...
 
Old 01-01-2005, 04:14 PM   #4
louis_m_c
LQ Newbie
 
Registered: Dec 2004
Location: Saint-Hubert, Canada
Posts: 26

Rep: Reputation: 15
Lightbulb

"If it's only for intranet purpose, you could use different domain names and
install a DNS server. "

In this case, every host in the local network that is set to use your DNS server would know that www.mydomain.org is (example) ip 192.168.1.5 and that www.mydomain2.org is 192.168.1.6. This is the "easy way" but you have to setup a DNS server.

It is well explained in the How-to I mentioned.

"Otherwhise, just use a redirector page on the main server. Let say, a blank page with only the javascript needed to forward the user to the other place."

What I mean is that you can use 1 virtual web site for your differents sites storage. All these servers use the exact same IP but different ports (80, 81, 82..). If let say your www.mydomain.org:81 site is located on a different IP then on the home page of this site, just put something like
<script>
location = "192.168.1.6/index.html";
</script>


"Another think I'm thinking of is if you use different ports than 80 for www you could use Nat tables from Iptables to redirect by example every traffic going to port 81 is redirected to ip 192.168.1.4."

It is similar to the redirector trick. In the Firewall configuration, it is possible to redirect every thing you want by using NAT... You choose the condition on a IP/Port basis. You could by example redirect every input going to "eth1" with TCP port 81 to anywhere you wish. This is normally used when using a Proxy to redirect calls to port 80 to 8080 (the proxy)... There are good how-to on that. But it may be too complicated for your needs.

For an easy configuration of this, use Webmin.

Personally, I would go with the DNS approach.
 
Old 01-02-2005, 08:53 AM   #5
helot
LQ Newbie
 
Registered: Dec 2004
Location: Chicago, USA
Posts: 3

Original Poster
Rep: Reputation: 0
thanks for all the info, i think i will try the dns approach first. I was hoping it can be done through dns somehow. Actually, i can have the domain name forwarded to my primary box and just have a subdomain to forward to the second box from the main box, because all i need is a forward for one page (something like box2.domain.com), if thats possible.
Here is my situation. My main server is an old k6-2 400 machine, which is quiet, runs cool and does not consume lots of power for 24/7 operation, and is great for just serving web pages and ftp. Now i am developing a Mapserver (GIS webmapping tool) app that requires lot of muscle power. I have all of the Mapserver stuff installed on a power hungry, loud-as-hell T-bird 800 machine (with four loud drives), but since i am not ready to deploy any of the map stuff yet, i just use it for testing. Eventually i will migrate everything on the faster box, but that might take months even a year, so something like the DNS approach should do for now.
Thanks again, at least i will learn a lot about DNS now.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mozilla opens URL as local tmp file? phlyersphan Linux - Software 1 11-08-2004 01:24 PM
View my site on network with url, not the local ip# neyoung Linux - Networking 3 02-02-2004 07:51 PM
Unable to run webpage on local server using ip in the url MakingOfAGeek Linux - Newbie 16 11-15-2003 07:09 AM
forwarding a local port Hano Linux - Networking 8 10-14-2003 12:20 PM
URL Forwarding MikeyCarter General 1 10-14-2003 10:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration