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.

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.

http://i54.tinypic.com/foekir.jpg

any hints?

share|improve this question
add comment

2 Answers

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.

EDIT:

You need to set up DNS records for www.domain.com and www.myotherdomain.com 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>
    Servername www.domain.com
    DocumentRoot /var/www/site
    ...
</VirtualHost> 

<VirtualHost *:80>
    Servername www.myotherdomain.com
    DocumentRoot /var/www/
    ...
</VirtualHost>

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
add comment

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 www.cheap-registrar.com 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
add comment

Your Answer

 
discard

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.