There are three basic steps to adding a virtual host on your Freedom server. To avoid potential problems for you or your customers, it is important to follow Steps 1 through 3 below in order:
Step 1: Register the Domain Name
Before adding a virtual host, it is important that the domain name be properly registered with an Internet registrar. In some cases, you may need to help the client register the domain name. In other cases, your potential client may already own the domain name, and may be hosting the domain on another provider's system. In such situations, you will need to assist the client in modifying the DNS information for their domain name, so that our name servers become authoritative for the domain. In either case, it is important that the domain name be properly registered and, if possible, that Web.com's name servers are authoritative for the domain.
Complete information on registering domain names and modifying DNS information can be found in the Freedom User Tutorials. We recommend that you become familiar with DNS procedures and terminology before you offer virtual hosting services to others.
Step 2: Request the DNS Addition
NOTE: Your Freedom product comes with a feature known as ""wildcard DNS."" This means that canonical domains such as ""anything.yourdomain.com"" will already point to your IP address and you do not need to request it to be added. If you are setting up a virtual host with a canonical domain, you can safely skip this step. It is a good idea to confirm this however before hand by using the nslookup command to verify that the canonical name does in fact point to your IP address.
Once a domain name is properly registered, you need to request that an entry for the domain be added to your DNS record in our name servers, or if you are using someone else's DNS services, you need to work with them to have the domain pointed to your Freedom server's IP address.
To request that the domain name be added to our name servers, please contact an Web.com Sales representative. You will need to provide the domain name that you want added, as well as the main domain name for your Web server.
There is a one-time setup fee for each additional domain that you add to our name servers. Currently, the fee for adding a domain name is $20.00. Once our staff adds the DNS record, you will receive a confirmation email.
Step 3: Configure the Virtual Host
WARNING: Because virtual hosts must point to your Freedom server's IP address before they will work properly, you should not configure a virtual host on your server until its domain name is properly pointed to your IP address through DNS. Doing so may cause unusual effects with any or all of the virtual hosts already on your server.
WARNING: Each Web.com Freedom server has a limit to the number of virtual hosts that can be configured. The vaddvhost command will not let you add a virtual host to your system if you have passed this limit. Please note that although it is possible to manually add virtual host declarations to your /www/conf/vhosts.conf file, exceeding the maximum number of allowed virtual hosts for your product will prevent the provided Apache Web server from starting.
Once your new virtual host is properly registered and added to our name servers, you can configure the virtual host on your Freedom account using the vaddvhost command. The vaddvhost command creates a home for the virtual host in the /www/vhosts directory, modifies /etc/mail/local-host-names to allow mail to be received for the new domain, and makes modifications to your /www/conf/vhosts.conf file in order to tell Apache about the new virtual host that it should provide service for.
Example: To add a domain name as a virtual host of your Freedom server, log into your Freedom account and enter the following command at the prompt:
> vaddvhost
The following series of prompts appear (denoted by even spaced type). For this example, we will add "acme.com" as a virtual host to your Freedom account. For each prompt that appears, enter the information denoted in bold type or hit [ENTER] to accept the default:
Enter the domain to add as a vhost: acme.com
The above command line instructs vaddvhost to create a directory called acme.com within your /www/vhosts directory. To help manage multiple hosts, it is recommended that you include the .ext extension.
Would you like to alias www.acme.com to acme.com? [Y]:
The www alias ensures that people will be able to visit your site at either acme.com or www.acme.com. Type Y or simply click [ENTER] to accept, or N to skip.
Would you like to alias any additional domains to acme.com? [N]:
You can add other aliases, or canonicals, to acme.com in the form canonical.acme.com. Type N or simply click [ENTER] to skip, or Y to enter additional aliases.
Would you like this vhost to have a cgi-bin? [Y]:
If you would like to allow your virtual host to have its own directory for storing and executing CGI programs, type Y or hit [ENTER] to create a cgi-bin directory within the virtual host's home directory.
Finally, a confirmation message appears, along with instructions to restart Apache (see the following note for important details).
IMPORTANT NOTE: As stated in the instructions for the vaddvhost program, You must restart Apache before the changes will take effect. To restart Apache, use the following command:
> apachectl restart
If you followed all three of the above steps correctly, your virtual host should now be functioning properly.
Please read the next section to understand the modifications that vaddvhost has made to your virtual server's configuration files, so that you or another member of the webadmin group can modify these settings if needed.