Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

There are two different web-apps running on two (physically) different servers on our network... one of IIS and another one on Apache - both on port 80 since two machines are accessible by different IPs on our internal network.

Now I want to expose both these services to the world. My idea is to somehow make the incoming connection redirect to the appropriate server based on user's choice of subdomain.

Example

xxx.domain.com maps to the IIS (Internal IP: 1.2.3.4)

yyy.domain.com maps to Apache (Internal IP: 5.6.7.8)

To the world, both these servers will share the same public IP.

What kind of a configuration am I looking at and how do I go about trapping the subdomain requests and redirecting to the appropriate server?

Thanks, m^e

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Your best bet is to put a reverse proxy in front of them if your edge device doesn't support virtual hosts.

share|improve this answer
    
Thanks for your prompt reply. Could you direct me to some guidelines/tutorials on the net on this? –  miCRoSCoPiCeaRthLinG Mar 8 '10 at 6:22
    
This is a link to the mod_proxy module for Apache, which is what you would use to set this up. httpd.apache.org/docs/2.2/mod/mod_proxy.html –  MDMarra Mar 8 '10 at 6:27
    
Also, if you are only planning on ever having two servers, you might as well just set up forwarding on the apache box instead of putting a dedicated reverse proxy in, however - actually having a reverse proxy will allow you to grow if you really don't want to get more public IPs. –  MDMarra Mar 8 '10 at 6:29
    
Ahaa... going through the rev. proxy docs I see that this would perfectly fit my purpose. Thanks again :) –  miCRoSCoPiCeaRthLinG Mar 8 '10 at 6:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.