LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 05-09-2005, 06:40 PM   #1
Marshalle
Member
 
Registered: Mar 2005
Location: Auckland, New Zealand
Distribution: OpenSuSE, SLE, Yoper, Sabayon
Posts: 68

Rep: Reputation: 15
Lightbulb Can I route web traffic to 2 different hosts based on URL under 1 IP Address?


I have two internal web servers. One is IIS the other is Apache/Tomcat. Does anyone know if it is possible to have a linux router or something like it to forward traffic to the relevant server based on the url they have entered?

Thanks,

M
 
Old 05-09-2005, 07:06 PM   #2
jrochamtz
LQ Newbie
 
Registered: Apr 2005
Location: México
Distribution: fedora
Posts: 12

Rep: Reputation: 0
what i have done is to set up an internal dns server and add hosts to the zone with their ip address like:

web IN A 10.0.0.1
mail IN A 10.0.0.2

then the url web.mydomain.com goes to 10.0.0.1 and mail.mydomain.com goes to 10.0.0.2

is it what you want to do??

greetings!!
 
Old 05-09-2005, 07:51 PM   #3
Darin
Senior Member
 
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024

Rep: Reputation: 45
You can also set this up in Apache, possibly in IIS as well.
Point both URLs to the Apache box and then in the apache config, add a redirect. Some info on this can be found at http://httpd.apache.org/docs/mod/mod_alias.html
 
Old 05-09-2005, 08:43 PM   #4
Marshalle
Member
 
Registered: Mar 2005
Location: Auckland, New Zealand
Distribution: OpenSuSE, SLE, Yoper, Sabayon
Posts: 68

Original Poster
Rep: Reputation: 15
I like both of these solutions, which do you think would be better. Basically it is for this:

IIS running exchange outlook web access
Apache running on Linux for a simple helpdesk app (forgot about that one)
Tomcat for a Java based eccommerce site that could end up with a bit of traffic.

Each of these will be on completely different domain names, but should all be accessible via port 80

One concern I might mention is if the Tomcat server got a lot of traffic it may not be wise having apache doing all the sorting? Also, because of the ecommerce I could see the Linux box doing some load balancing for redundant internet links, so I'm assuming if we are using it like a router Apache would be a bad Idea? ie more of a security risk?

Thanks heaps for any replies!

M
 
Old 05-13-2005, 10:43 AM   #5
jrochamtz
LQ Newbie
 
Registered: Apr 2005
Location: México
Distribution: fedora
Posts: 12

Rep: Reputation: 0
all will be accessed through the same ip??

if yes, I never have done it, but you can forward all packets from the router to the linux box wich contains the virtual domains, then in the virtal domain you choose if deliver local, or redirect to the other server using the redirect directive of the other post.

but i'm not shure it works even if the redirected server is not nated.

NameVirtualHost *:80
#
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
 
Old 05-14-2005, 04:02 AM   #6
Marshalle
Member
 
Registered: Mar 2005
Location: Auckland, New Zealand
Distribution: OpenSuSE, SLE, Yoper, Sabayon
Posts: 68

Original Poster
Rep: Reputation: 15
I think I understand what you mean, however there may be other servers added to the mix and while they probably won't be web servers I think it would be good to have the first router handle it (or the first hop). I believe what you are talking about is present in many cheaper routers and is called a DMZ. However it just really means forward all traffic to this ip unless otherwise specified. Is that what you meant?
 
  


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
Need help with Squid and capturing url traffic? atl02wrx Linux - Software 5 06-25-2005 06:36 PM
dhcp no ip address and netmask dont match route address pengy666 Linux - Wireless Networking 1 05-08-2005 10:33 AM
difference between "Web server local URL" and "IPv4 address"? kpachopoulos Linux - General 2 09-17-2004 02:30 PM
route any traffic between two NICs thirumala Linux - Networking 0 03-24-2004 06:54 PM
Route traffic like a hub atlesn Linux - Networking 2 03-21-2004 05:51 PM


All times are GMT -5. The time now is 05:57 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration