hejsa,

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

forgot to tell..

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


// Lasse - The linux geek

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.