Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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, they will be able to go to which will map to (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 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

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 ( 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 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. 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 accessible through HTTP? You can achieve the latter with Name Based Virtual Hosts ( 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


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