I just got a little problem..

i only have one public ip.. but i need to host several websites over many local ip's..

so, i need to forward the incomming requsts (from the public) to one of the local ip's.. based on the domainname..

so, mydomain.com > my public ip > main server forward the request (based on the domain name) > local ip (apache server) > the apache server return a answer

so, all i want is some kind of portforward with domain names..

My main question is.. how can i do that?

with C, C++, maybe PHP-cli
And what shall i use? sockets? or?

please explain in details :)

Regards, Lasse

Edited by brugernavn: spell fix

6 Years
Discussion Span
Last Post by brugernavn

forgot to tell..

The local IPs will serve as individual small VPS
and must not use the same apache server.. :)

// Lasse - The linux geek

Edited by brugernavn: n/a


I suppose it might be doable with some kind of proxy. You'd need something that listens to your public IP at port 80 and filters incoming requests by header, and then forward them to the correct destination. You should probably implement it in C++/C to get more speed since all traffic is going through just this one program.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.