H-Sphere Documentation Sysadmin Guide

For more information contact us at info@psoft.net

CGI Scripts
(version 2.1 beta and higher)

 

For more information contact us at info@psoft.net

H-Sphere 2.1 CGI scripts

H-Sphere 2.1 standard installation includes the following set of CGI scripts:
* Learn how to install additional CGI scripts.

  • Extropia's WebBBS (forum)
  • Counter
  • Extropia's WebChat
  • FormMail

    IMPORTANT: upgrade to the newest version (1.92) to eliminate security holes in the previous versions following the intsructions below:

    1. Download the patch executing the following command:
    # wget http://www.psoft.net/shiv/HSUpdate-21/formmail-update
    (for Linux)

    # fetch http://www.psoft.net/shiv/HSUpdate-21/formmail-update
    (for FreeBSD)

    2. Execute the script on the H-Sphere CP server under the root account using the following command:
    # sh ./formmail-update

  • Extropia's WebGuestbook

Step-by-step procedure of additional CGI scripts installation

1. Go to /hsphere/shared/skel/scripts

2. Put all the script related files to this directory according to the following structure:

/hsphere/shared/skel/scripts/cgi-bin/
- cgi script itself
* You can create a new subdirectory for your script.
* Set the script's permissions to 755
* Edit the main html page in cp/scripts/ and provide info on your new cgi script, include link to the script's author page, link to the demo, etc.

cp/scripts/"your_script"-doc/
- html files with documentation, license and version infomation, examples, etc.

cp/images/ - image files

3. Put new cgi script description which will be displayed to a user when enabling / disabling this script for his domain.

For Example:

"skellist.bscounter Features include: blocking of multiple hits from the same user, insertion of commas, text-based or graphical modes, supports multiple counters from the same script, and tracks users' browsers, operating systems, and location".

3.1. Create the directory shiva/custom/bundles/. If this directory already exists, skip this step.

3.2. In the listed files, find the string you want to modify. Next, in the newly created directory, create a new empty file with the name exactly like the one that contains the original string. For example, you are going to change the label Shell Access to SSH Access. It is stored in the shiva/psoft/hsphere/lang/hsphere_lang.properties file. Create the file shiva/custom/bundles/hsphere_lang.properties.

3.3. Copy the line with the identifier and the value you want to change into the new file and change its value the way you want.

WARNING: Don't copy the texts you are not changing!

3.4. Make sure the file is owned by user cpanel:cpanel.

3.5. Now you need to declare the custom files. In the hsphere.properties file, uncomment the line that corresponds to the file you have created:

CUSTOM_TEMPLATE_BUNDLE = custom.bundles.hsphere_lang
CUSTOM_MENU_BUNDLE = custom.bundles.menu
CUSTOM_USER_BUNDLE = custom.bundles.messages

3.6 Create two symlinks in your document root:
hsphere_lang_en.properties to hsphere_lang.properties and
menu_en.properties to menu.properties

3.7. Login as root and restart H-Sphere. You don't need to restart H-Sphere if you did nothing on step 4. If you don't know how to restart your H-Sphere, click here.

4. Go /hsphere/shared/skel/scripts/

5. Find skellist.txt.
Add a record about your new cgi script according to the following template:

bscounter|COUNTER|countsetup.html|skellist.bscounter|/hsphere/shared/skel/scripts|/cgi-bin/BSCounter /cp/images/digits /cp/scripts/countsetup.html /cgi-bin/tstcount.cgi

where:
(1) bscounter
- the name of the main cgi script without extension (one word; used for system needs).

(2) COUNTER
-
caption name (used for displaying the name of the script to a user).
* It can consist of several words, preferably in upper case.

(3)countsetup.html
-
main html page for your cgi script.
* On this page you can dispose the information about what this script is intended for. Link to the script author's site, links to the local resources, documentation, examples, demo, etc.

(4) skellist.bscounter
-
script description

(5) /hsphere/shared/skel/scripts
-
main path relative to which all cgi script related files are located.
* /hsphere/shared/skel/scripts by default

(6) /cgi-bin/BSCounter /cp/images/digits /cp/scripts/countsetup.html /cgi-bin/tstcount.cgi
- list of catalogues and files related to the script separated by spaces.

  1. *NOTE: Fields(1)-(6)should be separated with "|".

6. If you want information on user domain to be dynamically inserted in script related files (*.html, *.cgi, etc), you should put
!domain!
into the file and add extension *.in to this kind of files (for example: formmail.cgi -> formmail.cgi.in)
In this case in all the files with *.in extension instead of !domain! there would be user's domain indicated and then *.in extension will be removed.



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