             ----------------------------------------------
                             README for
            SmarterStats_Ensim_1.1_AddSite.exe and 
	    SmarterStats_Ensim_1.1_DeleteSite.exe
			     June 2003
             ----------------------------------------------
	(c) Copyright SmarterTools Inc. 2003. All rights reserved.

This document provides information on how to implement and use
SmarterStats_Ensim_1.1_AddSite.exe and SmarterStats_Ensim_1.1_DeleteSite.exe
with Ensim Webppliance(tm) Pro for Windows v3.2.1, here within referred to as Ensim.

If you have any questions that are not covered in this file, please contact
SmarterTools Inc. Contact information is below:

Support Email - support@smartertools.com
Support Forums - http://www.smartertools.com/forum/
website - www.smartertools.com

------------------------
HOW TO USE THIS DOCUMENT
------------------------

To view the Readme.txt on-screen in Notepad, 
maximize the Notepad window.

To print Readme.txt, open it in Notepad or another word 
processor, and then, on the File menu, click Print.

========
CONTENTS
========

SYSTEM REQUIREMENTS
  
SETUP
  Extracting files to temp directory
  Modifying .bat files
  copying files to end location
  Modifying .bat files if already exist at end location

TESTING INSTALLATION
  Add Site
  Delete Site

WHY MODIFY THE .BAT FILES

HOW TO MODIFY THE .BAT FILES

CUSTOMVIRTDOMAIN.BAT
  Explanation of Variables
  
CUSTOMDELVIRTDOMAIN.BAT
  Explanation of Variables
  

SYSTEM REQUIREMENTS
===================
SmarterStats v2.61 or later must be installed
Ensim Webppliance(tm) Pro for Windows v3.2.1 must be installed
Microsoft Framework 1.1 installed (should be installed by SmarterStats)


SETUP
=====

Extracting files to temp directory
--------------------------------------------
Before you can modify the .bat files, you must extract them to a temp
directory. Extract all files in the zip archive into this temp
directory.


Modifying .bat files
--------------------------------------------
The .bat files may have to be modified if you did not accept the defaults
when installing SmarterStats or Ensim. They may also have to be modified
if you have changed the default settings in SmarterStats after installation.


Copying files to end location
--------------------------------------------
Once the .bat files have been modified, if needed, all files must be copied
to their end location. It is very important that you copy the files to
proper directory, failure to do so will result in sites not being created
or deleted in SmarterStats when Added or Removed from Ensim.
Following the procedure below for copying files to end location. You will need
know the installation directory of Ensim to perform this task.

1. Open Windows Explorer and open <ensim install dir>\SiteData\webppliance\conf\custom\appliance
2. If CustomVirtDomain.bat or CustomDelVirtDomain.bat exist already, please see 
   instructions on Modifying .bat files if already exist at end location. If they
   do not exist, continue to next step.
3. Open a second Windows Explorer and open the temp directory where you extracted 
   the files from the zip archive to.
4. Copy and paste all files from the temp directory to the directory in step 1.
5. If you have:
     - Changed the Global Admin Username for SmarterStats
     - Changed the Global Admin Password for SmarterStats
     - Changed from using the SmarterStats Webserver to IIS
     - Used the SmarterStats Webserver Configuration tool to change the SmarterStats 
       Webserver settings
 
   then you will need to read HOW TO MODIFY THE .BAT FILES and modify the bat files before moving
   on to the next step.
6. Move on to TESTING INSTALLATION


Modifying .bat files if already exist at end location
---------------------------------------------
If the CustomVirtDomain.bat or CustomDelVirtDomain.bat already exist at the
end location, you cannot over-write them as they may contain customizations
to perform other actions. You must add to them as outlined in the steps below.

1. Open the CustomVirtDomain.bat file in the end location. To open the file, right click on it and select edit.
2. Open the CustomVirtDomain.bat file in the temp directory. To open the file, right click on it and select edit.
3. Copy the content from the first "Set" line to the last "Set" line and paste it into
   the top of the end location file.
4. Copy the rest of the contents of the temp file and paste it into the end location file
   under the "set" statements.
5. Follow steps 1 thru 4 but open the CustomDelVirtDomain.bat files instead.
6. If you have:
     - Changed the Global Admin Username for SmarterStats
     - Changed the Global Admin Password for SmarterStats
     - Changed from using the SmarterStats Webserver to IIS
     - Used the SmarterStats Webserver Configuration tool to change the SmarterStats 
       Webserver settings
 
   then you will need to read HOW TO MODIFY THE .BAT FILES and modify the bat files before moving
   on to the next step.
7. Move on to TESTING INSTALLATION


TESTING INSTALLATION
====================

Add Site
----------------------------------------------
When you add a site through Ensim, it should also find the CustomVirtDomain.bat file
and Execute it. If the adding was successful, you will have a site created in
SmarterStats. You should not have to do anything else. If the script was not successful,
you will have not site created in SmarterStats. If it was unsuccessful you can diagnose
the bat file by executing it at a command prompt and passing in some parameters.
Below is an example of how to call it at a command prompt.

c:\<ensim install dir>\SiteData\webppliance\conf\custom\appliance> CustomVirtDomain <domainName> <siteUsername>

If there was an error, it will display on screen. If it was successful, it will return to
the command prompt.

To test the addition of a site, please make sure that you have followed all the steps INSTALLATION.
Then login to Ensim as Appliance Administrator, and add a site. When the site is created, Login to
SmarterStats Web Interface and check that the site has been added. If it was not added, please follow
the steps for Diagnosing the .bat file outlined above.

For further help, please contact SmarterTools Support.

Delete Site
-----------------------------------------------
When you delete a site through Ensim, it should also find the CustomDelVirtDomain.bat
file and Execute it. If the deletion was successful, the site will no longer show up in SmarterStats.
If it was unsuccessful, the site will still exist in SmarterStats. If the site was removed from Ensim
but left in SmarterStats, you may delete the site manually thru SmarterStats Web Interface.
You may also choose to diagnose the bat file by executing it at a command prompt 
and passing in some parameters.
Below is an example of how to call it at a command prompt.

c:\<ensim install dir>\SiteData\webppliance\conf\custom\appliance> CustomDelVirtDomain <domainName>

If there was an error, it will display on screen. If it was successful, it will return to
the command prompt.

To test the deletion of a site, please make sure that you have followed all the steps INSTALLATION.
Then login to Ensim as Appliance Administrator, and remove a site. When the site is removed, Login to
SmarterStats Web Interface and check that the site has been removed. If it was not removed, please follow
the steps for Diagnosing the .bat file outlined above.

For further help, please contact SmarterTools Support.


WHY TO MODIFY THE .BAT FILES
============================

When you change from the default settings in SmarterStats you may need to change the
CustomVirtDomain.bat file to reflect these changes. The changes that will require
modification to the .bat file are as listed:

  - Change the Global Admin Username for SmarterStats
  - Change the Global Admin Password for SmarterStats
  - Change from using the SmarterStats Webserver to IIS
  - Used the SmarterStats Webserver Configuration tool to change the SmarterStats 
    Webserver settings

Changing any of the above and not changing the .bat files will result in Ensim not CREATING or
DELETING sites from the SmarterStats server.


HOW TO MODIFY THE .BAT FILES
============================

When you make any of the changes as noted in "WHY TO MODIFY THE .BAT FILES" you must modify the
CustomVirtDomain.bat and CustomDelVirtDomain.bat files. Below is an explanation of how to do this.

1. Open Windows Explorer and open the Open Windows Explorer and 
   open <ensim install dir>\webppliance\conf\custom\appliance
2. Open the CustomVirtDomain.bat file by right clicking on the file and seleting "edit"
3. Open the CustomDelVirtDomain.bat file by right clicking on the file and seleting "edit"
4. Now if you have changed the SmarterStats Global Admin Username or Password, change the
   following values:
	- authUsername = new SmarterStats Global Admin Username
	- authPassword = new SmarterStats Global Admin Password
5. If you have elected to not use the SmarterStats webserver and use IIS instead, change the
   following value:
	- url = new URL used to reach SmarterStats Web Interface. Note: If you are not using
	  port 80, the default port for IIS, you must specify the port in the url also,
	  localhost:9999 or 192.168.1.190:900
6. If you have used the SmarterStats WebServer Configuration tool to Change the Port or IP,
   change the following value:
	- url = new URL used to reach SmarterStats Web Interface. Note: If you are not using
	  port 80, the default port for IIS, you must specify the port in the url also,
	  localhost:9999 or 192.168.1.190:900
 

CUSTOMVIRTDOMAIN.BAT
====================

Explanation of Variables
-------------------------------------------------
Inside the CustomVirtDomain.bat file there are variables that get passed to the commandline
executable that adds the site to SmarterStats. Some of the variables are "hard coded" so
they will work out of the box. Below is an explanation of each variable.

  - url
	URL used to access the SmarterStats Web Interface. This is defaulted to localhost:9999 as
	that is what the default url to the SmarterStats Web interface is.

  - authUsername
	Global Admin Username for the SmarterStats Web Interface. This is the Username you use
 	to get into SmarterStats as the Admin.

  - authpassword
	Global Admin Password for SmarterStats Web Interface. This is the Password you use to
	get into SmarterStats as Admin.

  - username
	Site Admin's Username. This is passed in by Ensim on site creation.

  - password
	Site Admin's Password. This is the same as the Username

  - serverID
	Numerical ID of server that site exists on. Since Ensim runs on each Server individually,
	this should always be left at one.

  - domainName
	Name of the site being created. This is passed in by Ensim on site creation.

  - siteHome
	Location of the Ensim Domain File System root. This is an Ensim enviroment variable.

  - ensimSiteDataDir
	Install location of the Ensim Site Data directory. This is an Ensim enviroment variable.


CUSTOMDELVIRTDOMAIN.BAT
======================

Explanation of Variables
-------------------------------------------------
Inside the CustomDelVirtDomain.bat file there are variables that get passed to the commandline
executable that adds the site to SmarterStats. Some of the variables are "hard coded" so
they will work out of the box. Below is an explanation of each variable.

  - url
	URL used to access the SmarterStats Web Interface. This is defaulted to localhost:9999 as
	that is what the default url to the SmarterStats Web interface is.

  - authUsername
	Global Admin Username for the SmarterStats Web Interface. This is the Username you use
 	to get into SmarterStats as the Admin.

  - authpassword
	Global Admin Password for SmarterStats Web Interface. This is the Password you use to
	get into SmarterStats as Admin.

- domainName
	Name of the site being created. This is passed in by Ensim on site creation.

- ensimSiteDataDir
	Install location of the Ensim Site Data directory. This is an Ensim enviroment variable.

