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

We just went from shared hosting to a VPS server. We have several domain names that we have pointing to our dns, but they all point to the root of the server. What I would like now is a setup where every domain name gets its own map so we can run different sites on the VPS server.

Like: points to: /var/www/ points to: /var/www/

First of all, is this possible? Second, I have root SSH access and Webmin, on a LAMP server running on Ubuntu. Webmin doesnt have Bind9 (I dont know if I need that, some forums pointed me towards something called bind).

Thanks in advance

share|improve this question
up vote 1 down vote accepted

The technology that you need to get familiar with is Name Based Virtual Hosting. It's relatively easy to set up and a basic example would be something like this

Listen 80
NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot /var/www/

<VirtualHost *:80>
    DocumentRoot /var/www/

This accepts requests for, then serves the content from /var/www/ and requests for, then serves the content from /var/www/

Regarding bind9, if you already have all of your domain's DNS working with various registrars then right now that's the safest place for you to leave them.

share|improve this answer
Thanks man! I have it running! :) – Hans Wassink Sep 25 '12 at 11:10

As you mentioned you want to point to /var/www/ and same for every domain you have.

The answer is Yes you can do so. But you have to do configure your webserver (Apache) and add Virtual Hosts.

Read more on Virtual Hosts. You do not require Bind to run on your VPS unless you want to setup a full fledged DNS Server farm. Which i think you can avoid right now because you can use your Domain Registrar's DNS Servers to manage your domain.

All you have to do is to logon to your domain registrar account (e.g godaddy) then goto DNS Manager and Add an A record.

The A record tells us where a particular domain name is pointed at. It's value is IP Address.

So in your case if you have and you want to run this on your VPS then you have to modify A record for and enter the IP address of your VPS. Then goto your server and configure webserver to listen for

You can point all of your domain names in this way. But not to forget to read on virtual hosts.

share|improve this answer
Thanks for your answer man! I read up on Virtual hosts and I have everything running now! – Hans Wassink Sep 25 '12 at 11:10

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.