Parallels H-Sphere Documentation System Administrator Guide

 

Recovering Winbox

 
 

Related Docs:   Recreating Unix-Hosted Servers Recovering Winbox Quota

Last modified: 27 Dec 2007

 

WARNING: This documentation covers Parallels H-Sphere versions up to 3.1. For the latest up-to-date Parallels H-Sphere documentation, please proceed to the official Parallels site.

This document explains how to restore H-Sphere winbox configuration using the Physical Creator utility. If you have access to user homes, you can recover user content from this directory. If you don't, you'll need an earlier backup with preserved directory structure.

We suggest the following recovery procedure:

  1. Back up user content
  2. Install H-Sphere on the WinBox
  3. Set up Dedicated IPs if they have been added to this Winbox
  4. Prepare Target Winbox for PhysicalCreator
  5. Run PhysicalCreator on the CP box
  6. Restore content from backup if applicable
  7. Install Shared SSL
  8. Set correct NTFS permissions and Owner for the user home directories.
  9. Reinstall ASP.NET for all accounts that have it enabled in the CP
  10. Reinstall MSSQL enterpise manager for all accounts that have it enabled in the CP (for versions before 2.4)

 

Step 1. Back Up User Content

  1. Stop IIS by running the following commands from the command prompt:
    iisreset /stop
    net stop w3svc
    net stop ftp
  2. Rename the directory containing H-Sphere user homes. It will be used later to recover user content. If you don't have access to user homes, you'll have to recover user content from a backup.
  3. Start IIS:
    iisreset /start
  4. Create an empty HSHOME directory

 

Step 2. Install H-Sphere on the WinBox

  1. Make sure to have IIS (WebService) and FTP (IIS or Serv-U) installed.
    For information on IIS, run from the command prompt:
    %SystemRoot%\System32\Inetsrv\iis.msc
    For information on Serv-U FTP, check the task manager or Service Managere (full name : Serv-U FTP Server, short name: servu)
    FTP can be missing if the server is running only MS SQL.
  2. Follow Winbox preinstallation procedure as suggested in the WinBox Pre-Installation Guide.
  3. Follow Winbox installation procedure as suggested in the Winbox Installation Guide.
  4. After the installation, set up WebShell3 or WebShell4 depending on the version of H-Sphere (2.4.3 or 2.5).

 

Step 3. Set up dedicated IPs

  1. Go to the H-Sphere admin control panel and select the Winbox in L.Servers of the E.Manager -> Servers menu.
  2. Copy all Busy Dedicated IPs and their netmasks from the list of IPs into a text file the IPs to create a file with the following format:
        192.0.34.166   255.255.255.0
        160.79.224.130 255.255.255.0
        81.3.94.100    255.255.255.0
    
  3. Download IpCreator.
  4. Bind IPs using the IpCreator utility, passing the file with IPs as a parameter:
    IpCreator.exe FILE_WITH_IPS > log.txt

 

Step 4. Prepare Target Winbox for Physical Creator

  1. In the command prompt of the Winbox server, run:
    net stop HsQuotas
  2. Remove the content of the HSphere\skeleton directory.
  3. Put file skeleton_empty.exe in the HSphere\skeleton directory.
  4. Run skeleton_empty.exe with the '-dir'parameter:
    skeleton_empty.exe -dir

Note: when you finish the recovery, make sure you restored skeleton by means of H-Sphere updater for your version:

hsinst[your_hs_version].exe

 

Step 5. Run PhysicalCreator on the CP box

  1. Go to the H-Sphere admin control panel, select P.Servers of the E.Manager -> Servers menu, and click server info for the Winbox in question.
  2. Check if server info shows on the page that appears. If not, the CP server can't communicate with the Winbox; make sure to fix this issue before proceeding.
  3. Downolad tail utility for Windows and put it into the WINDOWS(win2003) or WINNT(win2000) directory.
  4. Log into the system database and run the following DB query to find out the number of domains to create:
    select count(*) from iis_vhost i,parent_child p,accounts a,user_account ua where i.id=p.child_id and p.account_id = a.id and a.deleted is null and ua.account_id = a.id and (a.demo <> 1 OR demo IS NULL) and host_id = ???;
    replacing ??? with the ID of the logical server you are recovering.
  5. Run PhysicalCreator as the cpanel user:
    java -Xms64M -Xmx512M psoft.hsphere.tools.PhysicalCreator -rg winweb -co -lid LOGICAL_SERVER_ID > creator.log 2>&1 &
    More on PhysicalCreator
  6. In the command line on the Winbox, run tail -f action.log to monitor the creation of Winbox resources.
  7. In another command line window, periodically check the number of created domains by running:
    find "CreateWebHost(" <HS_DIRECTORY>\logs\action.log /c
    for example:
    find "CreateWebHost(" d:\hsphere\logs\action.log /c

 

Step 6. Restore content from backup

  1. Update H-Sphere to restore original skeleton and renamed scripts.
  2. Back up IIS metabase using built-in IIS backup tools.
  3. Stop IIS:
    iisreset /stop
    net stop w3svc
    net stop ftp
  4. Copy user content to the directory for user homes.
  5. Start IIS:
    iisreset /start
  6. In the command prompt of the Winbox server, run:
    net start HsQuotas

 

Step 7. Install shared SSL

  1. In the admin control panel, install completely new Certificate key and file pair You can get them in /hsphere/shared/apache/conf/ssl.shared/[domain.name]/ on any Unix/Linux web server. This will repost the wildcard certificate on all servers, including the Winbox you are recovering.
  2. Download Recreation scripts in a zip archive and unpack them to a separate directory on the Winbox, for example recreation_scripts.
  3. Log into the system database and run the following DB query to select the domain names with shared SSL enabled:
    select s.name,hostnum,d.name from shared_ssl s, parent_child p1, parent_child p2, domains d, iis_vhost h where s.id = p1.child_id and p1.parent_id = p2.child_id and p2.parent_id = d.id and p2.child_id = h.id and h.host_id= ???;
    replacing ??? with the ID of the logical server you are recovering.
  4. Copy results of the query into a text file in the recreation_scripts directory and name it, for instance, S_SSL.txt. It will have the following format:
    sname1 | hostnum1 | domain_name1
    sname2 | hostnum2 | domain_name2
    ...
    snameN | hostnumN | domain_nameN

    where:
    snameX - is the third level domain secured with the wildcard certificate, e.g. user22.yourdomain.com
    hostnumX - is the domain ID in IIS
    domain_nameX - is the corresponding second level domain, e.g. user22.com.
  5. Enter the recreation_scripts directory and run the following command:
    sslprepare.bat %1 %2 %3 %4 %5 > SetSSL.txt
    where:
    rem %1 - is the file name you have created (e.g. S_SSL.txt)
    rem %2 - Winbox IP
    rem %3 - Service domain used for shared SSL
    rem %4 - H-Sphere login used at Winbox installation
    rem %5 - H-Sphere password used at Winbox installation.
  6. Open SetSSL.txt and remove the first part leaving only the list of links.
  7. Run the following command:
    WGET.EXE -i SetSSL.txt
    This will recreate all Shared SSL resources on the Winbox.

 

Step 8. Set correct NTFS permissions and Owner for the Home directory

For IIS FTP:

  1. Download SetScrt Tool:
  2. Run it to set correct owner and NTFS permissions on user home directories:
    - For HS 2.4.3, before 2.5:
    setscrt [-owner] [-ntfs] > setscrt.log
    You can run setscrt with the -owner option, then with the -ntfs option to break the process in two:
    setscrt -owner > setscrt_owner.log
    setscrt -ntfs > setscrt_ntfs.log
    - For HS 2.5 and up, before 2.5.0 Patch 7:
    SetScrtNs /ntfs /owner /hshome:<path>
    where path is the path to Hshome folder
    - For HS 2.5.0 Patch 7+ and 3.0 RC 2+:
    SetScrtNs20 /ftp:<number> /users:<file>
    where:
    ftp - default H-Sphere ftp host number
    users - user list file
  3. Check the log files for report.

Note: The following permissions are set on each specific customer directory:

- For HS before 2.5:

Group NTFS Permissions
Administrators
System
Full
User account Modify
Read & Execute
List folder
Read
Write

- For SERV-U FTP:

Group NTFS Permissions
Administrators
System
Full
IUSR_ account Modify
Read & Execute
List folder
Read
Write

- For HS 2.5 and up: Read more on NTFS Permissions in HS 2.5+

 

Step 9. Reinstall ASP.NET for all accounts that have it enabled in the CP

(for H-Sphere before 2.5 only)

On this step, we will use scripts in the recreation_scripts directory.

  1. Log into the system database and run the following DB query to select the domain names with ASP.NET support enabled:
    select d.name,i.hostnum from parent_child p1,parent_child p2,parent_child p3,parent_child p4,domains d,iis_vhost i where i.host_id=??? and p1.child_id = i.id and p1.parent_id = p2.child_id and d.id = p2.child_id and p3.parent_id=p2.child_id and p4.parent_id=p3.child_id and p4.child_type=63;
    replacing ??? with the ID of the logical server you are recovering.
  2. Copy results of the query into a text file in the recreation_scripts directory and name it, for instance, aspnet.txt.
  3. Enter the recreation_scripts directory and run the following command:
    aspnetprepare.bat %1 %2 %3 %4 > aspnet_links.txt
    where:
    rem %1 - file name, e.g. aspnet.txt
    rem %2 - Winbox IP
    rem %3 - H-Sphere login used at Winbox installation
    rem %4 - H-Sphere password used at Winbox installation.
  4. Open aspnet_links.txt and remove the first part leaving only the list of links.
  5. Run the following command:
    WGET.EXE -i aspnet_links.txt
    This will recreate all ASP.NET resources on the Winbox.

 

Step 10. Reactivate MS SQL ASP.NET Enterprise Manager for all accounts that have it enabled in the CP

(for 2.3.x version only)

Skip this step if you are using H-Sphere 2.4 or later. On this step, we will use scripts in the recreation_scripts directory.

  1. Log into the system database and run the following DB query to select the domain names with MSSQL manager enabled:
    select d.name,i.hostnum from parent_child p1,parent_child p2,parent_child p3,parent_child p4,domains d,iis_vhost i where i.host_id=??? and p1.child_id = i.id and p1.parent_id = p2.child_id and d.id = p2.child_id and p3.parent_id=p2.child_id and p4.parent_id=p3.child_id and p4.child_type=2153
    replacing ??? with the ID of the logical server you are recovering.
  2. Copy results of the query into a text file in the recreation_scripts directory and name it, for instance, mssql.txt.
  3. Enter the recreation_scripts directory and run the following command:
    mssql.bat %1 %2 %3 %4 > mssql_links.txt
    where:
    rem %1 - file name, e.g. mssql.txt
    rem %2 - Winbox IP
    rem %3 - H-Sphere login used at Winbox installation
    rem %4 - H-Sphere password used at Winbox installation.
  4. Open mssql_links.txt and remove the first part leaving only the list of links.
  5. Run the following command:
    WGET.EXE -i mssql_links.txt
    This will reactivate the MS SQL ASP.NET Enterprise Manager.

Related Docs:   Recreating Unix-Hosted Servers Recovering Winbox Quota



© Copyright 2017. Parallels Holdings. All rights reserved.