GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Virtual Subhosting: Manual Configuration

bullet Introduction
In order to manually configure a Virtual Subhost, connect to your Virtual Private Servers via Telnet or SSH and do the following.
  1. For each Virtual Subhost you configure on your Virtual Private Servers you will need to create a new directory for the Virtual Subhost domain files. It is best (to ensure compatibility with the latest version of Microsoft FrontPage) to create the new directory in your Virtual Private Servers ~/www/vhosts directory.

    % mkdir -p ~/www/vhosts/subhost-domain

  2. Open up your Virtual Private Servers ~/www/conf/httpd.conf file and add the following lines in the <VirtualHost> section (again, to ensure compatibility with Microsoft FrontPage) of the file. If your Virtual Private Servers was set up with just one web server configuration file (httpd.conf), then the <VirtualHost> section is found in the middle of the file.

    <VirtualHost www.SUBHOST-DOMAIN.NAME SUBHOST-DOMAIN.NAME>
    ServerName www.SUBHOST-DOMAIN.NAME
    ServerAdmin webmaster@SUBHOST-DOMAIN.NAME
    DocumentRoot /www/vhosts/subhost-domain
    </VirtualHost>
    

    You must substitute the Virtual Subhost domain name in place of SUBHOST-DOMAIN.NAME and the name of the directory you created for the Virtual Subhost for subhost-domain above. Also, be sure that the first domain name you list in the <VirtualHost...> directive above matches the domain name you specify as the ServerName (once again, to ensure compatibility with Microsoft FrontPage).

  3. Many of your Virtual Subhost customers will want to install their own CGIs into their own cgi-bin directory. If you choose to provide this feature, first you must create a cgi-bin directory for the Virtual Subhost.

    mkdir ~/www/vhosts/subhost-domain/cgi-bin

    Then, use the ScriptAlias directive in the ~/www/conf/httpd.conf file on your Virtual Private Servers

    <VirtualHost www.SUBHOST-DOMAIN.NAME SUBHOST-DOMAIN.NAME>
    ServerName www.SUBHOST-DOMAIN.NAME
    ServerAdmin webmaster@SUBHOST-DOMAIN.NAME
    DocumentRoot /www/vhosts/subhost-domain
    ScriptAlias /cgi-bin/ /www/vhosts/subhost-domain/cgi-bin/
    </VirtualHost>
    
    

    NOTE: It is important to understand the Virtual Subhosting Security Issues involved when giving cgi-bin access to your Virtual Subhost customers. Giving your Virtual Subhost customers cgi-bin access is a potential security risk! The CGIs your customers upload and execute have all of the rights and privileges of the CGIs you execute. Therefore, it is possible for a Virtual Subhost customer, which has been granted CGI privileges, to read or remove any file in your directory hierarchy. Moreover, it is possible for a malicious Virtual Subhost customer to crack weak passwords and gain shell access to your Virtual Private Servers.


  4. Many of your Virtual Subhost customers will want their own separate web server log files. If you choose to provide this feature, first you must create a logs directory for the Virtual Subhost web server log files.

    % mkdir ~/www/vhosts/subhost-domain/logs

    Then, use the TransferLog and ErrorLog directives to configure the web server log files in your ~/www/conf/httpd.conf.

    <VirtualHost www.SUBHOST-DOMAIN.NAME SUBHOST-DOMAIN.NAME>
    ServerName www.SUBHOST-DOMAIN.NAME
    ServerAdmin webmaster@SUBHOST-DOMAIN.NAME
    DocumentRoot /www/vhosts/subhost-domain
    TransferLog /www/vhosts/subhost-domain/logs/access_log
    ErrorLog /www/vhosts/subhost-domain/logs/error_log
    </VirtualHost>
    
    

  5. Most Apache Web Server resource directives can be included in your <VirtualHost> definition. For example, we can include the ErrorDocument directive in order to define a "Not Found Document" for the Virtual Subhost.

    <VirtualHost www.SUBHOST-DOMAIN.NAME SUBHOST-DOMAIN.NAME>
    ServerName www.SUBHOST-DOMAIN.NAME
    ServerAdmin webmaster@SUBHOST-DOMAIN.NAME
    DocumentRoot /www/vhosts/subhost-domain
    ErrorDocument 404 /notfound.html
    </VirtualHost>

    The "Not Found Document" location is specified with respect to the DocumentRoot. So, in the example above, the actual file location of notfound.html is:

    ~/www/vhosts/subhost-domain/notfound.html

  6. Finally, your Virtual Subhost customer will probably want a file upload account, in order to upload their own web site to the Virtual Subhost directory. Use the vadduser command to create Virtual Private Servers FTP User Accounts for your Virtual Subhost customers. When prompted for the account "home" directory, you will probably want to specify the same value that you used for the DocumentRoot directive above. This will allow your Virtual Subhost customer to upload web content to the directory which the web server recognizes as the home directory for the Virtual Subhost domain name.

    For more details about Virtual Subhosts and e-mail, see the following.

    • Virtmaps - Providing E-Mail for Virtual Subhosts


Toll Free 1-866-GSP-4400 • 1-301-464-9363 • service@gsp.com
Copyright © 1994-2016 GSP Services, Inc.