|
Last modified: 27 Dec 2007
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:
- Back up user content
- Install H-Sphere on the WinBox
- Set up Dedicated IPs if they have been added to this Winbox
- Prepare Target Winbox for PhysicalCreator
- Run PhysicalCreator on the CP box
- Restore content from backup if applicable
- Install Shared SSL
- Set correct NTFS permissions and Owner for the user home directories.
- Reinstall ASP.NET for all accounts that have it enabled in the CP
- 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
- Stop IIS by running the following commands from the command prompt:
iisreset /stop
net stop w3svc
net stop ftp
- 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.
- Start IIS:
iisreset /start
- Create an empty HSHOME directory
Step 2. Install H-Sphere on the WinBox
- 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.
- Follow Winbox preinstallation procedure as suggested in the
WinBox Pre-Installation Guide.
- Follow Winbox installation procedure as suggested in the
Winbox Installation Guide.
- 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
- Go to the H-Sphere admin control panel and select the Winbox in L.Servers of the E.Manager -> Servers menu.
- 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
- Download IpCreator.
- 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
- In the command prompt of the Winbox server, run:
net stop HsQuotas
- Remove the content of the HSphere\skeleton directory.
- Put file skeleton_empty.exe
in the HSphere\skeleton directory.
- 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
- 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.
- 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.
- Downolad tail utility for Windows
and put it into the WINDOWS(win2003) or WINNT(win2000) directory.
- 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.
- 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
- In the command line on the Winbox, run tail -f action.log to monitor the creation of
Winbox resources.
- 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
- Update H-Sphere to restore original skeleton and renamed scripts.
- Back up IIS metabase using built-in IIS backup tools.
- Stop IIS:
iisreset /stop
net stop w3svc
net stop ftp
- Copy user content to the directory for user homes.
- Start IIS:
iisreset /start
- In the command prompt of the Winbox server, run:
net start HsQuotas
Step 7. Install shared SSL
- 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.
- Download Recreation scripts
in a zip archive and unpack them to a separate directory on the Winbox, for example recreation_scripts.
- 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.
- 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.
- 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.
- Open SetSSL.txt and remove the first part leaving only the list of links.
- 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:
- Download SetScrt Tool:
- 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
- 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.
- 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.
- Copy results of the query into a text file in the recreation_scripts directory
and name it, for instance, aspnet.txt.
- 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.
- Open aspnet_links.txt and remove the first part leaving only the list of links.
- 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.
- 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.
- Copy results of the query into a text file in the recreation_scripts directory
and name it, for instance, mssql.txt.
- 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.
- Open mssql_links.txt and remove the first part leaving only the list of links.
- Run the following command:
WGET.EXE -i mssql_links.txt
This will reactivate the MS SQL ASP.NET Enterprise Manager.
|