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

I have a vps where a website is hosted on var/www/site rather than the usual var/www. I want a domain to point to var/www/site rather than var/www. Not sure what to put in the zones file.

any hints?

share|improve this question
up vote 5 down vote accepted

You ned to do this within your Apache configuration files. Find the vhost definition for your site and set or change the DocumentRoot to point to the /var/www/site directory. Set the ServerName or ServerAlias appropriately too.


You need to set up DNS records for and to point to the IP Address of your VPS. You need to set up name-based virtual hosting on your vps, and create a virtual host for each of your domains.

NameVirtualHost *

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

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

I think you really do need to spend some time reading the documents I've linked to (and the ones they link to) so that you understand the technology you are using.

share|improve this answer

If your VSP account is mainly controlled via their web portal, you are looking at the wrong screen for the web server (based on your screen shot). The screen shot is showing the DNS configuration which will not have anything to do with the actual web server configuration in regards to how its directory structure is set up.

You need to find the screen that deals with the web server settings itself. There should be a setting for the "web root" for the virtual domain configuration (assuming you are able to define multiple virtual web domains) that identifies where the web server can find the web files.

share|improve this answer
The vps doesn't come with a control panel, this is from which is a separate place where I bought the domain name. But I do have root access on the vps, so I'll have to do it manually, if that is what you mean – Kevin Duke Aug 30 '11 at 6:56
Yes, in that case you need to edit the configuration files for your web server. The DNS settings will not have anything to do with your web server's configuration. – user48838 Aug 30 '11 at 7:04

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.