Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple servers listening on same port

Status
Not open for further replies.

Arminius

Technical User
Nov 2, 2004
1
US
Hello,

I am currently trying to get httpd to only respond to requests with a particular domain. i.e. apache will only resond to requests for the and otherwise just ignore it and not send back any response.

Here are the details...

I have an LAN configured at home that connect to a linux box that runs as a router/firewall with iptables.

There are two linux boxes both sitting behind the firewall. Each box is running httpd.

I want both boxes to listen on port 80, but only respond to requests with a specific domain. this is because one box is mine, and the other belongs to a roommate, and we both want to use port 80.

I can configure iptables on the router to direct the trafic to both boxes, but can't get apache to only listen to a request with a specific domain.

So box1 should only respond to requests with and box2 should only respound to requests with

Thank You for any help

armin
 
First of all, I'd like to see how you can configure iptables to send the packet to both machines. I've never seen that config and I don't think the internal connection tracking would be able to handle all scenarios of multiple access to your sites. I could be wrong, but I'd be suprised if I was.

Second, the web server doesn't know what site the browser is requesting until after the TCP connection is established, which means many packets would have to be exchanged (SYN/ACK) before the client could send the request. Plus, the virt host specification comes *after* the URL request (GET / HTTP/1.1), so the client would have to be conversing with two different hosts on the same TCP connection. Not gonna happen.

I think you best bet would be to run a proxy on your firewall and proxy the request to the appropriate server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top