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 few things to add to the title.

Suppose we have a domain foo.com and a domain bar.com and we want the first to be served by apache and the second to be served by nginx (both running on the same machine, please consider the possibility to use also other web servers, like lighthttpd), and we want them to be accessible just writing the URL and without specifying any port (at least on client side, but a redirect on server side would be acceptable).

Is that possible? How to accomplish something like that? I don't know where to start and googling I can only find how to host multiple domain on the same server... that is not what I'm looking for.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

It is possible with a few different approaches.

1. Different IP-addresses

Point foo.com and bar.com to different IP-addresses on the same machine, and make each web server bind to one IP-address each.

2. Run a proxy

Run both domains as virtualhosts in one webserver, and then let e.g. bar.com get proxied back to the other web server.

share|improve this answer
    
Thank you very much. I'll study both approaches. –  Zagorax Sep 3 '12 at 16:20

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.