Set up a website on a virtual private server that hosts multiple websites

1. Some hosting service provider does not provide DNS name server to point to your VPS, so a custom DNS needs to be set up . Add a Forward Lookup Zone for the domain (e.g. foo.com). Go to the domain’s registrar’s website to configure it to use the custom DNS.  Another option is configure the DNS setting at the domain name registrar to point to the new server. For example, the steps of such configuration at registrar 1and1.com are the following:

  • Use 1&1 name server, but set an IP Address (A-Record) to the hosting server.   Suppose you have a domain foo.com, you can point the domain to IP 12.34.56.78.
  • One can use a different server for mail.  For example,  suppose foo.com has been configured to use 12.34.56.78 as the primary server, you can configure the DNS settings to use 23.45.67.89 as the host for mail.foo.com.  For 1and1.com, the trick is configuring the MX record.  One needs to use the option of “Other IP Address” for the Mail Exchanger (MS-Record), but it has to be a subdomain, not an IP address.  Therefore, create a subdomain pointing to the hosting serve.  The DNS settings of the subdomain needs to have its A/AAAA Records using "Other IP Address" and that IP Address is the hosting server's address (e.g. 23.45.67.89).  Therefore, one may use  12.34.56.78 to host www.foo.com, ftp.foo.com while using 23.45.67.89 to host his mail server mail.foo.org.
  • Use the subdomain for the MX Record of the DNS settings of the primary domain.

2. Create a directory for all websites (e.g. c:\web apps) if it does not exist.

3. Create a directory for a specific website (e.g. c:\web apps\foo).

4. Install IIS if it has not been installed ().

5. In IIS, add a website(e.g. Site name: www.foo.com, Physical path: c:\web apps\foo, Host name: www.foo.com).

6. Create a user account for this website.  Control Panel\User Accounts\User Accounts\Manage Accounts \Create a new account. Also create a password for this account (e.g foo).

7. Add FTP Publishing (on the right column when a website is selected). Enable Virtual Host Name (e.g. ftp.foo.com).  Allow SSL. Authentication: Basic. Allow access to: Specified users (e.g. foo).  A bug may need to be taken care of in order to make the FTP work.  Configure the security of the website to give full control to the specified users.   When accessing the website, the key thing to remember is the user name must be preceded with the host name (e.g. ftp.foo.com|foo).

8. Set up the email server. This depends on the email server.  The setup of SmarterMail is very straightforward, while the setup of hMailServer is more involved, but it is a very stable free server.

New DNS settings usually takes only a few hours to propagate. On a computer that cache DNS entries, one may have to clear the cache to get the new address quickly.  On Windows, one can run “ipconfig /dnsflush”.  On a Windows Server running a DNS, one has to go to DNS Manager to clear the cache first, then run “ipconfig /dnsflush”.

 

This article was updated on 11:33:13 2025-08-18