H-Sphere Documentation Sysadmin Guide

For more information contact us at info@psoft.net

Altering Virtual Host Configuration

 

Sometimes you might want to alter H-Sphere so it creates some additional entries in Virtual Host config files for a particular plan. You might need it to integrate java hosting, or some 3rd party CGI. For this, you would have to edit the file common/domain/vhost.config

vhost.config is the file for virtual host configuration. It has a form of a template, like any other template used in H-Sphere. You should read the guide on template customization and create custom templates directory as well as make a copy of the file before you start modifing the file.

First of all, choose a paramter to separate one plan from another. To do that, go to Info->Plans, and click settings next to the plan. Set variable, like TOMCAT_SUPPORT 1. After that, open the vost.config template, and add:

<if account.plan.values.TOMCAT_SUPPORT == "1">
    ...
</if>

Within this IF clause, do whatever you got to do for that virtual host config. This way, only plans with that setting would have this entry.

There are 3 scripts that are used for domain, on domain creation, deletion, and when some alteration to the config is done. This is how they are called:

  • On domain creation:
    apache-vhost
    apache-saveconf

  • On domain removal:
    apache-delconf

  • On update:
    apache-saveconf

Script

Description

Parameters

/hsphere/shared/scripts/apache-saveconf

creates a site configuration file

$1 - id of the site

/hsphere/shared/scripts/apache-delconf

deleting vhost file

$1 - id of site configuration removed (we don't remove files)

/hsphere/shared/scripts/apache-vhost

creating vhost directory

$1 - directory inside user directory
$2 - username
$3 - group name
$4 - permission to the directory
$5 - domain
$6 - instant alias
$7 - cpanel login
$8 - control panel url
$9 - SiteStudio url
$10 - SiteStudio class name (you should not care about those, it is done for the first page the user will see)



Home   Products   Services   Partners   Support   News   Contact   Forum
© Copyright 1998-2003. Positive Software Corporation.
All rights reserved.