2

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?

1

2 Answers 2

5

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.

0
1

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.

2
  • 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
    – dukevin
    Aug 30, 2011 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, 2011 at 7:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .