H-Sphere Sysadmin Guide

Control Panel Server Configuration

 

Control Panel (CP) is the H-Sphere logical representation for managing servers and hosting resources via web interface. It is implemented as a Java servlet that runs on its own Apache server. CP is a separate logical server and is included in every H-Sphere configuration.

This document covers the following Control Panel issues:

 

Installed Software

  • Apache server v.1.3.29
  • SSL support: OpenSSL v.0.9.7c
  • CP back-end servlet engine:
    - before v.2.4 -- Apache JServ: jdk 1.3.x + jsdk2-2.0
    - v.2.4 betas 1-3 -- Jakarta Tomcat: jdk 1.4.x + jsdk2-2.0 + tomcat 4.1.x
    - v.2.4 beta 4 and up -- Jakarta Tomcat: jdk 1.4.x + jsdk2-2.0 + tomcat 5.1.x
  • System database management (only one of the following):
    - PostgreSQL server v.7.1.3 or higher -- default H-Sphere system database.
    - Oracle v.8.x-9.x (Unix server) -- requires special configuration
    - MSSQL 7 or 2000 (separate Windows server) -- requires special configuration
    Note: Oracle and MSSQL are provided only on clients' demands. Client should have these DBMSs installed; they are not included into the H-Sphere package.
  • Additional packages:
    - SiteStudio v.1.6 - H-Sphere package that enables end users building their own sites even without basic web design knowledge.
    - XFree86-Xvfb-4.x.x - package used by SiteStudio ImageMaker for image generation.
 

Client-Server Interaction in CP

  • For clients working on UNIX servers, CP runs Shell or Perl scripts via SSH protocol.
  • For clients working on Windows servers, CP runs ASP scripts via HTTP.

 

Location Of CP Files And Directories

By default, the cpanel user home directory is /hsphere/local/home/cpanel.

There you will find the following files and directories:

apache - CP Apache installation
apache/etc - CP Apache configuration
apache/etc/httpd.conf - CP Apache configuration file
shiva - H-Sphere related binary and config files
shiva/psoft_config - H-Sphere config files
shiva/psoft_config/hsphere.properties - H-Sphere config file
shiva/psoft_config/HS_VERSION - file that contains version number of H-Sphere
shiva/shiva-templates - H-Sphere templates location, DocumentRoot for Apache server.
shiva/shiva-templates/index.html - Redirect to control panel; served when the http://cp.domain.com:8080/ CP URL is accessed

/hsphere/shared/SiteStudio/psoft_config/masonry.properties - SiteStudio config file (could be on a different server)

IMPORTANT:
To make changes in these files, log into the CP server as the cpanel user, e.g., from root:
su - cpanel

 

The H-Sphere Configuration File (hsphere.properties)

The H-Sphere configuration file should be located at ~cpanel/shiva/psoft_config/hsphere.properties

1) CP URL configuration - URL by which H-Sphere is called:
CP_HOST = cp.domain.com -- host name
CP_PORT = 8443 -- port
CP_PROTOCOL=https:// -- protocol
CP_URI = /psoft/servlet/psoft.hsphere.CP

Notes:
- This is not the only place where those settings have to be altered.
- URI cannot be changed here at the moment.
- Make sure that DNS is properly configured if you want to change domain.
- Make sure to alter apache if you want to change domain and port.

2) Database settings (see the system dababase settings below)

3) Log file:
log4j.appender.A1.File=/var/log/hsphere/hsphere.log - location of the log file.

 

Control Panel Apache Server Configuration

CP Apache home directory is /hsphere/local/home/cpanel/apache.

All CP Apache server configurations are placed into the etc/jserv subdirectory of the Apache home directory: /hsphere/local/home/cpanel/apache/etc/jserv.

This directory also has its symlink: /hsphere/local/home/cpanel/apache/conf.

 

Control Panel Back-End Servlet Engine

Before version 2.4, Control Panel's back-end servlet container was Apache JServ. Starting from version 2.4, CP server uses Jakarta Tomcat servlet engine and is automatically installed with Tomcat embedded.

JServ Configuration
(before v.2.4)

/hsphere/local/home/cpanel/apache/etc/jserv - JServ configuration directory. In this directory:

  • jserv.conf - JServ configuration
  • jserv.properties - JServ properties
  • zone.properties - JServ zone file

Tomcat Configuration
(v.2.4 and up)

Tomcat installation is located in the /hsphere/local/home/cpanel/jakarta directory.

Important: The core H-Sphere directories such as shiva, shiva-templates, psoft, and psoft-config are now located in the /hsphere/local/home/cpanel/hsphere/WEB-INF/classes/ directory with H-Sphere classes run by Tomcat. Symlinks to these new locations are put in place of the old directories to preserve H-Sphere integrity with previous versions' configuration.

Tomcat Configuration Files

Tomcat configuration files are located in the /hsphere/local/home/cpanel/jakarta/conf directory.

/hsphere/local/home/cpanel/jakarta/conf/server.xml - XML config file for Tomcat;
/hsphere/local/home/cpanel/hsphere/WEB-INF/web.xml - XML configuration file where CP servlet configuration is set;
/hsphere/local/home/cpanel/apache/etc/mod_jk.conf - mod_jk configuration. mod_jk is a Tomcat-Apache plug-in that handles the communication between Tomcat and Apache. For more details, see Apache documentation on mod_jk.

Tomcat Log File

Tomcat log file is /hsphere/local/home/cpanel/apache/logs/mod_jk.log.

Restart Tomcat

Stop Tomcat:
/hsphere/local/home/cpanel/jakarta/bin/catalina.sh stop
Start Tomcat:
/hsphere/local/home/cpanel/jakarta/bin/catalina.sh start

Tomcat is also restarted in H-Sphere restart (Tomcat is restarted together with CP Apache):
/etc/init.d/httpdcp restart

Note: Sometimes you might need to restart only CP Apache, keeping Tomcat running. Then, use the following option:
/etc/init.d/httpdcp restartapache

 

Reseller Configuration

/hsphere/local/home/cpanel/apache/etc/sites/ contains resellers' SSL and virtual host configuration.

  • /hsphere/local/home/cpanel/apache/etc/{reseller_main_account_name}.conf - reseller Apache virtual host configuration file
  • /hsphere/local/home/cpanel/apache/etc/{reseller_main_account_name}/ - reseller SSL directory.

Reseller SSL Configuration

If SSL is enabled for reseller, the following files are placed into the reseller SSL directory:

  • server.crt - reseller SSL certificate
  • server.key - reseller SSL private key

CP SSL Configuration

In the /hsphere/local/home/cpanel/apache CP Apache home directory:

  • etc/ssl.crt/server.crt - file with server SSL certificates.
  • etc/ssl.csr/server.csr - file with SSL signing request.
  • etc/ssl.key/server.key - file with SSL/RSA private key.
 

CP Apache Log Files

Log files are located in the /hsphere/local/home/cpanel/apache/logs directory.

 

CP Traffic Calculation

Traffic generated from browsing the Control Panel is not included in the summary traffic. To track it, H-Sphere owners can set up custom packages.

 

The H-Sphere System Database

The H-Sphere system database is used to store system data. In normal H-Sphere configuration, it runs on PostgreSQL server, but it may be installed on a separate Windows-based MSSQL server. Henceforth we will talk about the system database on PostgreSQL, unless noted otherwise.

Usually, the system database is located on the same server with the Control Panel.

The system database is not used for hosting. PostgreSQL hosting server could not be installed on the same box with the system database.

The H-Sphere database is executed under the pgsql or postgres user.

The System Database Settings

Database settings in hsphere.properties (this should be enough to connect to db):

DB_DRIVER = org.postgresql.Driver
DB_URL = jdbc:postgresql://127.0.0.1/hsphere - the system database name, usually hsphere
DB_USER = wwwuser - the system db user name, usually wwwuser
DB_PASSWORD = your_db_password - the system db user password
DB_NEWID = SELECT nextval(''{0}'')

Logging Into The System Database

To log into the system database:

  1. Login as cpanel to the server where the system database is located (usually, CP server):
    # su - cpanel
  2. Enter the hsphere database (usually, under the wwwuser user name):
    # psql hsphere [user_name]

See also the instructions on:

VACUUM Utility

The Postgres VACUUM instruction allows cleaning up the server transactions. Enter the psql server:
# psql hsphere wwwuser and type in the password set in hsphere.properties.

In the psql command line, type the 'vacuum full' command:
vacuum full;
The command may vary in different versions of Postgres.

Note: vacuum is a time-consuming procedure; it may take up to several hours to complete!

 

CP Mail Queue
(v.2.4 and up)

The mail queue file is assigned to store unsent CP messages (e.g., trouble tickets, system notifications, mass mail, etc.) when CP is restarted - formerly, they were lost after CP restart. Mail queue location is set in hsphere.properties:

MAIL_SWP=/hsphere/local/home/cpanel/shiva/mail.swp

 



© Copyright 1998-2004. Positive Software Corporation.
All rights reserved.