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!

Linux Virtual Servers on one box without additional IPs

Status
Not open for further replies.

dworkin

ISP
Mar 22, 2003
3
US
Alright, Before I get started trying to rewrite apache trying to do this I wanted to see if anyone out there knew if there might be a way to do virtual servers on a linux box.
Now, I know about the regular LVS stuff but thats not going to help me. Here is what I'm trying to do:
1. I want my users to be able to type in thier web page and get to it on my computer. (That means that DNS servers around the world are going to have to be pointing at my server.
2. I want them to be able to ftp and have full access to thier allocated space on my server but only have access to thier files. (Which means that 1st my machine is going to have to determine where there "root" access point is, and not only with ftp (thats easy) but with ssh as well, so my server is going to have to put them into a virtual server.
3. I know I could do all this with LVS but I don't have the money to pay for indevidual IP addresses for everyone. So here is my Idea: I wonder if it might be possible to use the local host network (127.0.0.0) to set up virtual servers using LVS. Then I could have one client be 127.0.0.2 and .3, .4 and so forth. Now that I think about it though I don't know if I could set it up with that address so I could use my eth0 to set up a 10.0.0.0 network inside my computer that would do the same thing. Here's the problem though. How am I going to make my computer say user UserX = 10.0.0.3 when they log in using ssh. And Also how would I make Apache say ok I know where is it's at one of my fake 10 network addresses, my database says it's 10.0.0.3.

Anyway I think I explained it well enough that you can figure out my problem. Thanks for your help! And if I left something out, just let me know!

Thanks

Dworkin
 
There is no way to perform one-to-many (from one routable IP address to many non-routable addresses) HTTP hosting without using specialized software (such as LVS) or port-based routing.

But unless you are going to be doing hosting HTTPS, you only need one IP address on the server to host multiple sites. The HTTP 1.1 specification provides for an HTTP header "Host:", which the web client uses to tell the web server the name of the host it is trying to contact. For example, my web client will pass a header of "Host: if I am contacting that server. This is where the Apache "ServerName" and "ServerAlias" directives come in handy.

(This won't work with HTTPS because the encryption handshaking happens before any HTTP headers arrive, so the web server has no way which certificate to use on muliple sites sharing an IP address.)

Without port-based routing, some mechanism on your network must examine headers to see where to route the packets. Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top