LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 02-06-2009, 01:19 PM   #1
compucoder
LQ Newbie
 
Registered: Jan 2009
Posts: 17

Rep: Reputation: 0
Route to LAN based on URL


Hi everyone,

I am questioning whether I need to keep paying for 5 static IPs. The only reason I have all 5 of them is because we host multiple web servers and I use a different public IP on the firewall (Ubuntu Server) to port forward to the right server.

Is it possible to use use IPTables to check what URL a connection is coming in for and route accordingly? I use Shorewall and would like to use this to do it if it is possible. I don't even know if this is an IPTable thing or some other tech. is needed.

Thanks.
 
Old 02-06-2009, 01:54 PM   #2
SteveInTallyFL
Member
 
Registered: May 2008
Location: Tallahassee, FL
Distribution: RHEL4, RHEL 5, OEL4, OEL5
Posts: 65

Rep: Reputation: 17
Have you thought about mod_rewrite?

Assuming you are hosting with Apache and all 5 servers are virtualized on the Ubuntu box, could you not use mod_rewrite with RewriteCond and RewriteRules to forward to particular web sites?
 
Old 02-06-2009, 06:56 PM   #3
compucoder
LQ Newbie
 
Registered: Jan 2009
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by SteveInTallyFL View Post
Assuming you are hosting with Apache and all 5 servers are virtualized on the Ubuntu box, could you not use mod_rewrite with RewriteCond and RewriteRules to forward to particular web sites?
The Websites are on 3 dedicated servers behind the firewall. I DNAT 1 Public IP for each server.

What I was hoping to do was to use 1 public IP and on the firewall DNAT to the correct web server based on the domain / URL coming in. Each server does have Apache and a few sites on it. I just wanted to see if I can go down to 1 Public IP for these 3 servers and DNAT based on the incoming URL / domain.

Any ideas?
 
Old 02-07-2009, 06:57 PM   #4
SteveInTallyFL
Member
 
Registered: May 2008
Location: Tallahassee, FL
Distribution: RHEL4, RHEL 5, OEL4, OEL5
Posts: 65

Rep: Reputation: 17
If the ubuntu box is the public server it must be your DMZ. I would think you could internalize the other servers (10. or 192. space addresses) and tightly limit the ports from the firewall to the internal web servers. DNAT sound like a perfect way to go.
 
Old 02-07-2009, 07:21 PM   #5
compucoder
LQ Newbie
 
Registered: Jan 2009
Posts: 17

Original Poster
Rep: Reputation: 0
I am already doing that. I have all servers behind the firewall. The problem is all 3 of them listen on port 80 which means I have to DNAT 3 Public IP's to these servers.

What I was hoping to do is detect what URL a person is coming in on (on the firewall) and based in that URL DNAT to the proper web server behind the firewall. If I can do this then I can just use 1 public IP and DNAT to the right web server behind the firewall. The thing holding this plan up though is that I don't know how to do this.

I believe Microsoft's ISA server can do this and am sure Linux has an equivalent (probably better) way of doing the same thing.

Hopefully I am explaining what I am trying to do properly.

Thanks.
 
Old 02-08-2009, 03:42 AM   #6
sal_paradise42
Member
 
Registered: Jul 2003
Location: Utah
Distribution: Gentoo FreeBSD 5.4
Posts: 150

Rep: Reputation: 16
You can setup squid as a reverse proxy with multiple webservers behind it.
http://wiki.squid-cache.org/ConfigEx...fc9490cce5940a
 
  


Reply



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
redirecting to multiple hosts based on url wolfipa Linux - Server 4 08-11-2008 09:24 AM
URL based restrictions arsridhar Linux - Security 2 03-24-2008 01:36 AM
URL based traffic shaping Britboy Linux - Networking 1 02-05-2007 09:11 AM
route based on ports lhrt Linux - Networking 2 11-19-2006 11:06 PM
Can I route web traffic to 2 different hosts based on URL under 1 IP Address? Marshalle Linux - Networking 5 05-14-2005 03:02 AM

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

All times are GMT -5. The time now is 11:02 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