AlpineWeb Home
Search: For:   ~ Advanced Search  
  Support Home     Documentation     Knowledgebase     Help Desk     Blog 
Hosting > Managed Private Servers > Getting Started > Monday, October 06, 2008

FreeBSD MPS: Getting Started Guide - Managing Subhosts


Your MPS v3 allows you to configure multiple Web sites and domains in addition to the main domain of the server. The main domain or site for the server is called the hostname. Place the Web content for this site in the /usr/local/apache2/htdocs directory.

You may have configured a custom hostname during the order process. To aid with configuring and testing your server, all MPS v3 servers receive a temporary domain name, or temp domain, which resolves to your MPS v3. This domain can be used if the custom hostname is 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.
Note: 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 Apache (version 2.2.3, installed by default) looks for VirtualHost entries in the /usr/local/apache2/conf/httpd.conf file. The vaddhost v-command assists in the creation of the subhost configuration VirtualHost tags in your Apache configuration file.

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:
  1. Type vaddhost and press Enter. Instructions and information for vaddhost will display during this step and throughout the vaddhost process.
  2. Type the domain for the subhost (domain.com, for example), any secondary domains (www.domain.com, store.domain.com, etc), and any other domains used for this subhost, pressing Enter after each. The first domain entered will be the main domain for the subhost. Additional variations will be aliases that point to the main domain. Press Enter without any text after providing all variations to move to the next step.
    Note: The hostname or subhost usually consists of the top-level domain (domain.com) instead of a canonical name such as www.domain.com. Canonical names are usually added as secondary domains or aliases.
  3. 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.
  4. 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.) This user should be the owner of the site files and folders; otherwise the Web server will not be able to load the site.
  5. 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:
  1. To enable SSL for the subhost type y and press Enter or type n and press Enter to not enable SSL for the subhost.
  2. Verify the information and type y and press Enter to continue or type n and press Enter to input the SSL information again.
  3. Type the email address of the subhost administrator and press Enter.
  4. Verify the information and type y and press Enter to continue or type n and press Enter to input the address again.
  5. 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, which will create a subhosted directory in the home directory of the user specified in step 4.
  6. 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:
  1. Select an option for the subhost transfer log and press Enter.
  2. Verify the information and type y and press Enter to continue or type n and press Enter to choose the transfer log configuration again.
  3. Select an option for the subhost error log and press Enter.
  4. Verify the information and type y and press Enter to continue or type n and press Enter to choose the error log configuration again.
  5. Select an option for the subhost cgi-bin and press Enter. This will allow the subhost to execute scripts and programs.
  6. Verify the information and type y and press Enter to continue or type n and press Enter to choose the cgi-bin configuration again.
  7. 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.
  8. If you typed y to accept the entry, type y and press Enter to restart the Web server and complete the subhost addition.
Note: 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:
  1. Edit the httpd.conf file and remove the VirtualHost entries for the subhost in question.
  2. After modifying the httpd.conf file, execute the restart_apache command from the command line to restart the Web server.
  3. Remove any unneeded files or directories for the subhost from the server.
Note: See Removing Users 3 for further information about subhost files and directories assigned to a user and considerations when removing that user.



Technical Support
° Getting Started Guides
  FreeBSD
° Basic Hosting Help
° Signature Hosting Help
° VPS v1 Help
° VPS v2/3 Help
° MPS v2/3 Help
  Linux
° VPS v3 Help
° MPS v3 Help
  SaaS
° Sugar CRM
  DNS
° Domain Name Service
° Domain Registration
° Help Desk
° Knowledgebase
° Support Policies
° Disclaimer

° AlpineWeb Home
° Compare Hosting Plans
° Network Topology

° Rates & Fees
° Order Center




  Home | Site Map | Customer Backroom Copyright  ©  1997-2008  AlpineWeb Design