Managing Subhosts and Certificates
Prior to the introduction of support for multiple IP addresses, your FreeBSD MPS v3 server enabled configuration of multiple
Web sites and domains in addition to the main domain of the server. (or hostname). The hostname and subhosts were associated
with the single, base IP address for the account. You may have placed the Web content for your hostname in the
/usr/local/apache2/htdocs directory. You may also have configured a custom hostname during the order process. To assist with
the process of configuring and testing your server, all MPS v3 servers receive a temporary domain name (or temp domain) which
resolves to your MPS v3 server. Use this domain if the custom hostname is temporarily inaccessible or does not yet resolve to
your server. Other domains or sites hosted by your server are called subhosts. This section explains adding, removing, and
configuring subhosts with the additional consideration of multiple IP addresses.
Because a standard, default MPS v3 server supports just one IP address, you can only associate one SSL certificate with the
standard SSL port (443) for the Web server. You can, however, configure your Web server to use the Apache Listen directive to
monitor other ports for SSL requests, and associate other certificates with these different ports. Doing this requires you to
indicate the port number in the Universal Resource Locator (URL). With the addition of support for multiple IP addresses, this
non-standard type of configuration is no longer necessary for those who purchase the use of additional IP addresses.
New and Updated Command-line Utilities
The assistance provided by the vaddhost command-line utility continues with the addition of prompts to enable you to associate
a subhost with the base IP address or another IP address associated with your account. A command-line utility, vaddcert, is
added to enable you to install certificates for different domains which can now utilize different IP addresses.
To execute the vaddhost and vaddcert commands or to edit to the httpd.conf file, as instructed in the following sections, you
must verify you are the root user. You can become the root user by typing su - at the command line and supplying the root user
password. Also, you can press ctrl+c to exit the vaddhost or the vaddcert process at any time. This immediately cancels
vaddhost and any subhost configuration entered during the vaddhost process is lost.
Adding a Subhost
The hostname or subhost typically consists of the top-level domain (example.com) only instead of a canonical name such as
www.example.com. Canonical names are usually added as secondary domains or aliases. With the assistance of a command-line
utility, you can configure subhosts (and canonical variations) to comply with the Apache VirtualHost directive. The Apache
software looks for VirtualHost entries in the following file:
/usr/local/apache2/conf/httpd.conf
The vaddhost command assists you as you create a subhost configuration VirtualHost tags in your Apache configuration file.
While the configuration task is presented in three sections you must complete all of the steps to complete the configuration
of the subhost which complies with the Apache VirtualHost directive.
From your server's command-line interface, follow these steps to begin configuring the subhost. After you have completed these
steps, you will have specified the domain and administrator:
Throughout the following steps, the system periodically displays the list of domains, canonical variations, and IP addresses
for verification.
- Type vaddhost and press Enter. Instructions and information for vaddhost will display during this step and throughout the vaddhost process.
- Type the domain for the subhost (such as example.com), any secondary domains (such as www.example.com or store.example.com), and any other domains used for this subhost, pressing Enter after each. The first domain entered will be the ServerName (or main domain) for the subhost. Additional variations will be aliases that point to the main domain.
(Or press Enter without any text after providing all variations to move to the next step. The system displays the list of domains and variations for verification.)
- Type the username of the administrative user for the subhost and press Enter. This user should be the owner of the Web site files and folders; otherwise the Web server will not be able to load the site.
- Verify the information and type y and press Enter to continue.
(Or type n and press Enter to input the username again.)
- Type the IP address with which you wish to associate the subhost and press Enter.
(Press Enter prior to typing an IP address to see a list of available IP addresses.)
- If the listings of domains, canonical variations, and IP addresses are correct, type y and press Enter.
(Or, type n and press Enter to input the information again.)
Administrative Email and Document Root settings
After you have added a subhost, continue the configuration and specify administrative email as well as document root (or
Web directory) settings. Follow these steps from the command line:
- Type the email address of the subhost administrator and press Enter.
- Verify the information and type y and press Enter to continue.
(If the information is incorrect, type n and press Enter to input the address correctly.)
- Type the path for the subhost Web directory, or document root, on the server. The vaddhost command simplifies this step and provides a recommended path for you. You can press Enter without typing a path to select this default and create a subhosted directory in the home directory of the user specified in the previous step.
- Verify the information, type y and press Enter to continue.
(If the information is incorrect, type n and press Enter to input the path correctly.)
Log and cgi-bin settings
After you have configured administrative email and document root settings, specify log and Common Gateway Interface Binaries
(cgi-bin) settings. Follow these steps from the command line:
- Select an option for the subhost transfer log and press Enter.
- Verify the information, type y, and press Enter to continue.
(Or type n and press Enter to choose the transfer log configuration again.)
- Select an option for the subhost error log and press Enter.
- Verify the information, type y, and press Enter to continue.
(Or type n and press Enter to choose the error log configuration again.)
- Select an option for the subhost cgi-bin and press Enter. This will enable the subhost to execute scripts and programs.
- Verify the information and type y and press Enter to continue.
(Or type n and press Enter to choose the cgi-bin configuration again.)
- The system will display the VirtualHost entry to be added to the httpd.conf file for confirmation. Type y and press Enter to add the entry to the httpd.conf file.
(Or type n and press Enter to halt the vaddhost process.)
- If you typed y to accept the entry, type y and press Enter to restart the Web server and complete the subhost addition.
Assigning a New SSL Certificate
This release offers a new command-line utility (vaddcert) which enables you to assign a new SSL certificate to a host. Follow these steps to use vaddcert to assign a new SSL certificate.
- Select the host to which the new SSL certificate will be assigned.
If the host is not listed, check the Apache configuration to verify that another SSL certificate is not previously assigned to the IP address and port. Also verify that the host's SSLEngine directive is set to 'on'.
- Enter the file path of the SSL certificate file to be installed.
- Enter the file path of the SSL certificate key file to be installed.
The following lines will be added to Apache configuration for ServerName.
example.securesites.net
SSLCertificateFile /usr/local/apache2/conf/ssl2.crt
SSLCertificateKeyFile /usr/local/apache2/conf/ssl2.key
- If the information is correct, press y to continue.
- Press y to restart Apache now.
A Syntax OK message is displayed.
Going Beyond the Basics
You may configure a subhost further by editing the VirtualHost entries for the subhost in the
/usr/local/apache2/conf/httpd.conf file. Execute the restart_apache command from the command line after editing the file to
restart the Web server and make the changes effective.

|