TimeUtils class


The TimeUtils class is designed to subsitute all other H-Sphere classes dealing with time. This class is needed for testing any H-Sphere features that use time ( like accounts, domain registration renewals, and the like ).

TimeUtils wrappers should be used instead of any other Date/Time functions:

System.currentTimeMillis() = TimeUtils.currentTimeMillis()
new java.util.Date = TimeUtils.getDate()
Calendar.getInstance() = TimeUtils.getCalendar()
Thread.sleep(s) + TimeUtils.sleep(s)

Other utilities HIGHLY recommendable for usage:

java.sql.Date getSQLDate()
java.sql.Timestamp getSQLTimestamp()
java.sql.Time getSQLTime()
java.util.Time getTime()

external credits, or external charges


external credits, or external charges are the charges exported from external billing systems.

External charges are stored in the external_credits table. The ecCron internal CP cron adds charges from external billing software to the external_credits table as the accounts’ credits.

To set the time interval when ecCron is launched, you need to add the following line to hsphere.properties:

EX_CHARGE_CRON=5

In the above example, ecCron would start every 5 minutes.

The external_credits table is created during H-Sphere upgrade and has the following structure:

CREATE TABLE external_credits (
id int NOT NULL,
account_id int4,
amount float,
created timestamp with time zone,
description varchar(128),
PRIMARY KEY(id)
);

To set individual interface preferences


Customers are being provided a facility to set individual interface preferences: preferred design (skin), icon set, or language – for a particular account.

This can be implemented within an H-Sphere template by using the following Freemarker commands:
<assign res = account.preferences(“KEY”, “VALUE”)> – set account preferences.

Here:

KEY is the key of an interface preference to be assigned to an account (up to 64 chars),
VALUE is its value (up to 256 chars).

The following keys are available in H-Sphere :

design_id – preferred design id (in design_config.xml);
icon_image_set – preferred icons image set (in design_config.xml);
skill_icon_set – preferred icons skill set (in design_config.xml);
lang – preferred language.

For example, to assign the XPressia design for an account:

<assign res = account.preferences(“design_id”, “xcp”)>

<assign property1 = account.preferences(“KEY”)> – retrieve account preferences.

Script-runner


Script-runner is a utility that launches H-Sphere scripts on Unix/Linux servers.
For this, H-Sphere control panel establishes an SSH connection with a Unix box and runs script-runner:ssh -a -x root@xxx.xxx.xxx.xxx /hsphere/shared/scripts/script-runner.plFurther, the control panel sends commands to the output stream of the SSH session and script-runner reads and performs the commands and then outputs.

The format of command passed to script-runner is:
COMMAND=command_name&PARAM1=param1&..&PARAMN=param n&INPUT=inputn
It starts with the keyword COMMAND followed by actual command. Then, if necessary, it’s followed by the parameters that are numbered from 1 and further. All parts of the command are separated with the ampersand (&). The ‘=’ symbol is followed by the value. The command ends with the line feed character.

If the command requires standard input, you should set the INPUT parameter. Commands are passed in the 8-bit ASCII encoding. Command parameters and standard input are passed in the URL-encoding.
Script-runner returns output in the following format:
OUTPUT=some_output&ERROR=text_of_error_or_empty_st ring&EXIT_CODE=0
If there is an error during script execution, parameter ERROR will contain the error text and output code EXIT_CODE will be nonzero. OUTPUT is a standard script output.

To check if script-runner is ready to accept commands, use ‘PING’ command. You should get the ‘PONG’ output.

Script-runner 1.8 logs all executed scripts and their output. They can be found in the /var/log/scriptrunner directory on the box where script-runner is running.

Migrating H-Sphere Control Panel


hi,
i have a Web hosting account with H-Sphere Control Panel, now i want to Migrating H-Sphere Control Panel to a different server. Plz. help

Migrating H-Sphere Control Panel :-

  1. Prepare for migration

  2. On the target server, install the latest stable version.

  3. On the source server, update to the latest stable version.
  4. Make sure the source and target servers have the same versions of all software packages.
    For example, make sure that the target server has the same version of PostgreSQL as the source server.

  5. Move system data

  6. Log into the target server as the cpanel user.

  7. Copy files and directories in the table below from the source server to the target server with the rsync utility:
  8. Stop H-Sphere CP on the target server.
  9. Stop H-Sphere CP on the source server.
  10. Repeat the rsync command for each of the above directories to synchronize any changes made while you were copying the data.

  11. Change IPs on the target server

  12. Switch the IPs of the source and target servers. To do this, you’ll need to run the setup utility on each of the two servers.

  13. Reboot both source and target servers simultaneously to avoid having the same IP on both servers.
  14. Restart the router.
  15. Start H-Sphere CP on the target server.

Traffic calculation of site


hi,
my site is hosted with cpwebhosting.net. how can i do traffic calculation of my site?

There are two types of traffic calculation in H-Sphere:

  1. Traffic calculation by third-party log analyzers – H-Sphere writes log files for each customer’s domain into respective directories to make them available for third-party log analyzers included into default H-sphere installation: Webalizer, Modlogan, and AWStats.

2. H-Sphere built-in traffic calculation – H-Sphere provides its own mechanism of traffic calculation used in billing. H-Sphere traffic reports are available in admin CP as Transfer Traffic Report in the Reports menu.

Domain Renewal


hi,
my Domain name will expire next month.can i Extend domain registration with the help of H-Sphere?

yes, u can do Domain Renewal with the help of H-Sphere

there are two types to do Domain Renewal In H-Sphere

  1. manual and
  2. automatic renew modes.

For Manual Domain Renewal:-

In Manual renew mode, you will be warned about domain expiration in advance, so that you can renew the domain on time. To renew your domain manually:

  1. Go to your CP Domain Settings/Domain info menu, and click the domain name link.
  2. On the page that appears in section Domain Renew Mode, click the Renew domain link.
  3. Choose a domain renewal period in the form, you will be taken to
    4.Press Submit and agree to charges, if any.

Automatic Renew Mode

If you have opted for an Automatic Renew Mode, the domain will be automatically renewed the number of years, you specified when choosing the Domain Renew Mode. The charges for a renewal will be made according to your plan settings

Domain Transfering


hi,
i want to move domains already registered from outside my CP. how can i do it?

Yes, u can transfer domains.
u can update domain’s info and change its DNS servers in the OpenSRS or Enom databases to the H-Sphere ones.

Transfered domains are registered with OpenSRS or Enom for the period chosen at transfer plus the time remaining from registration with original registrar.

XML API and H-shpere Services


H-Sphere XML API is designed to manage H-Sphere services via SOAP protocol. It is based on Apache Axis implementation of SOAP and runs under Apache Tomcat engine.

New with control panel


What do I do to get started and understand the control panel?

When you first opened your account you received an e-mail with your account information. This e-mail provides you with everything you need to access and publish to your new web account.

There is a default web page placed in your web folder, which you can also use as a login page, until you overwrite the page with your web site index.html page. You can always login to your control through our main site.

At any time, you can open a support ticket through your control panel as well. This is the way we address all support issues. We can respond quickly and have the ability to assign the best support representative to your inquiry while tracking and measuring our levels of support.