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.

On Linux and Apache, I am trying to figure out how I can assign unique IP addresses to user home directories?

In case your curious, it is a dev server. And instead of the users looking up foo.server.com/~user, they will be able to go to foo.server.com which will map to foo.server.com/~user. (They can do that once they update their local host file with the ip address.)

The users will be doing web development work under their home directories.

share|improve this question

migrated from stackoverflow.com Jul 29 '11 at 1:53

This question came from our site for professional and enthusiast programmers.

    
Consider using different ports in place of different IP addresses eg. server:81 - Luke server:82 - Sam –  Silverfire Jul 29 '11 at 3:13
    
If it's a dev server, it might be on an RFC1918 network, so using many IP addresses is fine. –  Tom O'Connor Jul 29 '11 at 7:09

3 Answers 3

You need to research host-based virtual server feature of your web server. You don't need different IP addresses, you just need different names in the DNS pointing to one IP address.

share|improve this answer
    
It's the same host name (foo.server.com). But the users will have different IP addresses. The idea is for them to update their host files (on their PC, mac, whatever), so they can map this address to foo.server.com. They could also use the IP address in the browser. Either way, it will show what is under their home directories. –  sqlman Jul 28 '11 at 4:52
    
But that also necessitates altering the network ocnfiguration on the host. If you use name-based virtual hosts the users just assign their name to the same IP address (e.g. joe.server.com) and the HTTP server can map that to a different location. This is most common these days. –  Keith Jul 28 '11 at 5:03
    
Perhaps I am thinking of IP-based virtual hosts. From what I remember, I didn't use this IP address to ssh. I only used it in the browser. This definitely seems like an Apache configuration. –  sqlman Jul 28 '11 at 5:10

Do you need really need unique IP addresses for ssh or just to have http://username.server.com/ accessible through HTTP? You can achieve the latter with Name Based Virtual Hosts (http://httpd.apache.org/docs/2.0/vhosts/name-based.html) on apache with a single IP. You will need different DNS entries for your users or you could use a wildcard entry.

share|improve this answer

Easiest way to achieve this is to create a virtual host for the ip and map its documentroot to the home directory you want.

Make sure you have set appropriate permissions on user's home directory.

Regards, Nehal Dattani

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.