Subhosts
The VPS allows you to configure multiple Web sites and domains for your account besides the main domain. The main domain or site for the account is called the hostname. Place the content for this site in the /usr/local/apache2/htdocs directory.
You may have configured the hostname during the order process. To aid with configuring and testing your account, all VPS accounts also receive a temporary domain name, or temp domain, which resolves to your VPS account. This domain can be used if the hostname is inaccessible or does not yet point to your account.
Other domains or sites hosted by your account are called subhosts. This section explains adding, removing, and configuring subhosts.
To execute the vaddhost command or edit the httpd.conf file, you must be the root user. You can become the root user by typing su at the command line and supplying the root user password.
Adding a Subhost
Subhosts are configured with the Apache VirtualHost directive. The system looks for VirtualHost entries in the /usr/local/apache2/conf/httpd.conf file. The vaddhost v-command assists in the creation of the VirtualHost tags needed for subhost configuration.
Subhost configuration includes many variables. While separated here into three sections, the entire process includes all three and you must complete all of them to entirely configure the subhost.
To begin the subhost configuration and specify the domain and administrator, follow these steps from the command line:
- 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 (domain.com, for example), any other variations of the domain (www.domain.com, store.domain.com, etc), and any other domains used for this subhost, pressing Enter after each. 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 y and press Enter to continue or type n and press Enter to input the domains again.
- Type the username of the user who will administer the subhost and press Enter. (Press Enter without any text to display a list of existing users.)
- Verify the information and type y and press Enter to continue or type n and press Enter to input the username again.
- To continue the configuration and specify SSL, administrative email, and document root (web directory) settings, follow these steps from the command line:
- To enable SSL for the subhost type y and press Enter or type n and press Enter to not enable SSL for the subhost.
- Verify the information and type y and press Enter to continue or type n and press Enter to input the SSL information again.
- Type the email address of the subhost administrator and press Enter.
- Verify the information and type y and press Enter to continue or type n and press Enter to input the address again.
- Type the path for the subhost web directory, or document root, on the account. 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, which will create a subhosted directory in the home directory of the user specified in step 4.
- Verify the information and type y and press Enter to continue or type n and press Enter to input the path again.
- To continue the configuration and specify log and cgi-bin settings, follow these steps from the command line:
- Select an option for the subhost transfer log and press Enter.
- Verify the information and 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 and 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 allow 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 abort 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.
- Press ctrl+c to exit the vaddhost process at any time. This immediately cancels vaddhost and any subhost configuration entered during the vaddhost process is lost.
Configuring a Subhost
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.
Removing a Subhost
The /usr/local/apache2/conf/httpd.conf file contains the configuration for subhosts. To remove the subhost configuration from the Web server, follow these steps:
- Edit the httpd.conf file and remove the VirtualHost entries for the subhost in question.
- After modifying the httpd.conf file, execute the restart_apache command from the command line to restart the Web server.
- Remove any unneeded files or directories for the subhost from the server.
|
|