Manual Installation of the Enterprise Extensions

If you are installing on a platform that supports the GUI installer (Windows, Linux, Unix), it is recommended that you use that. If not, but you are on a platform that supports the silent form of the installer (again Windows, Linux, Unix), it is recommended that you use that. Otherwise, or if you have other requirements, use the manual installation.

The installation work required is dependent on your target environment. Follow the guidelines for manual installation for your target platform that are documented for the Community Edition. These instructions will supplement those.

However you plan to install KonaKart Enterprise Extensions, it is still advisable to run through the GUI installer if you can. The reason for this is that it will populate all the properties files for you and load your database automatically. Once you have done this you can make WARs from the GUI-installed version of KonaKart (details below) and deploy them elsewhere as you please.

The KonaKart Enterprise Extensions Installation section contains general KonaKart Enterprise Extensions installation instructions (although focuses on using the GUI-driven and silent versions of the installer) and contains important information that is also relevant for the manual installation so check this before starting out.

In general, you need to follow all the documented installation instructions except for the "Install Enterprise Extensions" section which explains how to use the automated GUI and Silent versions of the installation.

Perform all the documented installation instructions for:

For the purposes of this guide we'll use MySQL and a database named "store1" (and "store2" where applicable).

  1. Copy the Enterprise Extensions files into position

    Unzip the KonaKart-Enterprise-n.n.n.n.zip file for your version on top of the existing KonaKart Community edition installation. Ensure that you unzip to the home directory of the existing KonaKart installation so that all the files are loaded into the correct positions.

  2. Modify the KonaKart Configuration Files

    1. Set Database Parameters

      Modifications should only be required if you have chosen Multi-Store Multiple Database Mode (Engine Mode 1). For all other modes, the database parameters should already be set correctly.

      Set DB name (and other database connection parameters) in konakart.properties and konakartadmin.properties Change the string "dbname" in the URL for MySQL to the name of your database (in this case "konakart") in the following files:

      {konakart}/webapps/konakart/WEB-INF/classes/konakart.properties

      {konakart}/webapps/konakartadmin/WEB-INF/classes/konakartadmin.properties

      This is documented in the "Defining the Database Parameters" section of the Community Edition installation.

      For Multi-Store Single DB Modes (Engine Mode 2) there is no difference to the database definition required in the two properties files. However, if you are using the Multi-Store Multiple DBs Mode (Engine Mode 1) you will need to enter database connection credentials for each of your stores. An example of a two-store set-up is:

      
      # -----------------------------------------------------------------------------------
      #  D A T A B A S E  P R O P E R T I E S
      # -----------------------------------------------------------------------------------
      
      torque.applicationRoot = .
      
      torque.database.default                         = store1
      
      torque.database.store1.adapter              = mysql
      torque.dsfactory.store1.connection.driver   = com.mysql.jdbc.Driver
      torque.dsfactory.store1.connection.url      = 
                    jdbc:mysql://localhost:3306/store1?zeroDateTimeBehavior=convertToNull
      torque.dsfactory.store1.connection.user     = root
      torque.dsfactory.store1.connection.password = 
      
      # Enterprise Feature
      torque.database.store2.adapter              = mysql
      torque.dsfactory.store2.connection.driver   = com.mysql.jdbc.Driver
      torque.dsfactory.store2.connection.url      = 
                    jdbc:mysql://localhost:3306/store2?zeroDateTimeBehavior=convertToNull
      torque.dsfactory.store2.connection.user     = root
      torque.dsfactory.store2.connection.password = 
      
      # -----------------------------------------------------------------------------------
      #  C O N N E C T I O N   P O O L   P R O P E R T I E S
      # -----------------------------------------------------------------------------------
      # We can leave the defaults
      # -----------------------------------------------------------------------------------
      
      # Using commons-dbcp 
      
      torque.dsfactory.store1.factory=org.apache.torque.dsfactory.SharedPoolDataSourceFactory
      torque.dsfactory.store2.factory=org.apache.torque.dsfactory.SharedPoolDataSourceFactory
      
      # The maximum number of active connections that can be allocated from this pool at 
      # the same time, or zero for no limit.
      
      torque.dsfactory.store1.pool.maxActive=0
      torque.dsfactory.store2.pool.maxActive=0
      
      # The maximum number of active connections that can remain idle in the pool, without 
      # extra ones being released, or zero for no limit. 
      
      torque.dsfactory.store1.pool.maxIdle=10
      torque.dsfactory.store2.pool.maxIdle=10
      
      # The maximum number of milliseconds that the pool will wait (when there are no 
      # available connections) for a connection to be returned before throwing an exception,
      # or -1 to wait indefinitely. 
      
      torque.dsfactory.store1.pool.maxWait=-1
      torque.dsfactory.store2.pool.maxWait=-1
      
      # The indication of whether objects will be validated before being borrowed from the
      # pool. If the object fails to validate, it will be dropped from the pool, and we will
      # attempt to borrow another. 
      
      torque.dsfactory.store1.pool.testOnBorrow=true
      torque.dsfactory.store2.pool.testOnBorrow=true
      
      # The SQL query that will be used to validate connections from this pool before 
      # returning them to the caller. If specified, this query MUST be an SQL SELECT 
      # statement that returns at least one row. 
      # Recommended settings:
      # for MySQL/PostgreSQL/MS SQL use: SELECT 1
      # for Oracle                  use: SELECT 1 from dual
      # for DB2                     use: SELECT 1 FROM sysibm.sysdummy1
      
      torque.dsfactory.store1.pool.validationQuery=SELECT 1
      torque.dsfactory.store2.pool.validationQuery=SELECT 1    
      
      

      Notice how most of the Torque parameters are repeated for each store.

    2. konakartadmin.properties

      The changes required are dependent on the chosen Engine Mode.

      For Multi-Store Multiple Databases Mode (Engine Mode 1) you need to define the databases that are used for each store. These parameters can be ignored for other Engine Modes. This is an example of a two database setup with databases store1 and store2:

      
      # -----------------------------------------------------------------------------------
      # Enterprise Feature
      # The databases actually used in a multi store / multi database environment
      # The "used" database definitions must map to the Torque definitions above
      # The "description.*" definitions are friendly names for the Stores
      
      konakart.databases.used = store1 store2
      konakart.databases.description.store1 = Store1
      konakart.databases.description.store2 = Store2
      
      

      For all Multi-Store Modes (Engine Modes 1 and 2) you need to define the Engine Mode that the web services engines will use: This is an example of a definition for Engine Mode 2:

      
      # -----------------------------------------------------------------------------------
      # Enterprise Feature
      # Engine mode that the web services engine will use
      # 0 = Single Store (default)
      # 1 = Multi-Store Multiple-Databases (add konakart.databases.used above as well)
      # 2 = Multi-Store Single Database
      
      konakart.ws.mode = 2
      
      

      Note the reminder in the comment above to set the konakart.databases.used property for Engine Mode 1 (Multi-Store Multiple Database Mode).

      For Multi-Store Single Database Mode (Engine Mode 2) you need to define whether or not you are operating in the Shared Customers Mode. This setting is not used for other engine modes. This is an example of a definition for defining that you wish to use Shared Customers:

      
      # -----------------------------------------------------------------------------------
      # Enterprise Feature
      # When in multi-store single database mode, the customers can be shared between stores
      
      konakart.ws.customersShared = true
      
      

      For Multi-Store Single Database Mode (Engine Mode 2) you also need to define whether or not you are operating in the Shared Products Mode. This setting is not used for other engine modes. This is an example of a definition for defining that you wish to use Shared Products:

      
      # -----------------------------------------------------------------------------------
      # Enterprise Feature
      # When in multi-store single database mode, the products can be shared between stores
      
      konakart.ws.productsShared = true
      
      

    3. konakartadmin_gwt.properties

      Modify this file as required to set the Engine Mode and appropriate value for customersShared and productsShared. The file is deployed to {konakart}/webapps/konakartadmin/WEB-INF/classes/ .

      The following example shows a setup for EngineMode 2 with Shared Customers and Shared Products:

      
      # -----------------------------------------------------------------------------------
      # Enterprise Feature
      # Engine mode that the KonaKart Admin engine will use
      # 0 = Single Store (default)
      # 1 = Multi-Store Multiple-Databases (add konakart.databases.used above as well)
      # 2 = Multi-Store Single Database
      
      konakartadmin.gwt.mode = 2
      
      # -----------------------------------------------------------------------------------
      # Enterprise Feature
      # When in multi-store single database mode, the customers can be shared between stores
      
      konakartadmin.gwt.customersShared = true           
      
      # When in multi-store single database mode, the products can be shared between stores
      
      konakartadmin.gwt.productsShared = true
      
      

    4. konakart.properties

      The changes required are dependent on the chosen Engine Mode.

      The database parameters should be set up in the same way as you did in the konakartadmin.properties file (see above).

      For Multi-Store Multiple Databases Mode (Engine Mode 1) you need to define the databases that are used for each store. These parameters can be ignored for other Engine Modes. This is an example of a two database setup with databases store1 and store2:

      
      # Enterprise Feature
      # The databases actually used in a multi store / multi database environment
      konakart.databases.used = store1 store2
      
      

      Define the web services Engine Mode and the customers shared property as you did in konakartadmin.properties (see above). Here is an example of a setup that defines Engine Mode 2 without sharing customers or products:

      
      # -----------------------------------------------------------------------------------
      # Enterprise Feature
      # Engine mode that the web services engine will use
      # 0 = Single Store (default)
      # 1 = Multi-Store Multiple-Databases (add konakart.databases.used above as well)
      # 2 = Multi-Store Single Database
      
      konakart.ws.mode = 2
      
      # -----------------------------------------------------------------------------------
      # Enterprise Feature
      # When in multi-store single database mode, the customers can be shared between stores
      
      konakart.ws.customersShared = false
      
      # When in multi-store single database mode, the products can be shared between stores
      
      konakart.ws.productsShared = false
      
      

    5. struts-config.xml

      A few modifications need to be made to the struts-config.xml file to set the mode of the KonaKart plugins. The Engine Mode must be set to 0 (Single Store mode), 1 (Multi-Store Multiple DBs Mode) or 2 (Multi-Store Single DB Mode). If you are using Engine Mode 2 and you have chosen Shared Customers you must also set customersShared to "true" otherwise leave that as "false". Likewise, set productsShared to true or false as appropriate.

      
      <plug-in className="com.konakart.plugins.KKEngPlugin">
              <set-property property="propertiesPath" value="konakart.properties"/>
              <set-property property="mode" value="2"/>
              <set-property property="customersShared" value="true"/>
              <set-property property="productsShared" value="true"/>
              <set-property property="definitions-debug" value="2"/>
          </plug-in>
      
          <plug-in className="com.konakart.plugins.KKAppEngPlugin">
              <set-property property="propertiesPath" value="konakart.properties"/>
              <set-property property="appPropertiesPath" value="konakart_app.properties"/>
              <set-property property="mode" value="2"/>
              <set-property property="customersShared" value="true"/>
              <set-property property="productsShared" value="true"/>
              <set-property property="definitions-debug" value="2"/>
          </plug-in>
          
      

    6. Populate the Database ready for the Enterprise Extensions

      This is an example of a Windows BAT file that you should run for setting up a Multi-Store Single DB (Engine Mode 2) system. This utility also creates a second sample store (called "store2") just as is done in the automated installation process. You need to configure the properties files (see above) before executing this program because it needs to know the chosen configuration:

      
      @echo off
      rem
      rem Set up database for KonaKart Enterprise Extensions
      rem Also sets up a second sample store (store2) in the database 
      rem  - Manual Installation Only
      rem
      rem  Normally this is executed by the Enterprise Extensions Installation Wizard
      rem
      
      set INSTALL_DIR=C:/Program Files/KonaKart
      set WEBAPPS_DIR=C:/Program Files/KonaKart/webapps
      set DBDIR=MySQL
      set SHARED_CUSTOMERS=True
      set SHARED_PRODUCTS=True
      
      set CP=%WEBAPPS_DIR%\konakartadmin\WEB-INF\classes
      set CP=%CP%;%WEBAPPS_DIR%\konakartadmin\WEB-INF\lib\konakartadmin_multistore.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakartadmin\WEB-INF\lib\konakartadmin.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakartadmin\WEB-INF\lib\konakartadmin_multistore.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakartadmin\WEB-INF\lib\konakartadmin_solr.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakartadmin\WEB-INF\lib\konakartadmin_publishproducts.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\konakart.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\konakart_utils.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\konakart_torque-3.3.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\velocity-1.5.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\konakart_village-3.3.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\commons-pool-1.3.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\commons-dbcp-1.4.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\commons-configuration-1.7.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\commons-beanutils-1.7.0.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\commons-lang-2.1.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\commons-collections-3.2.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\commons-logging-1.1.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\log4j-1.2.12.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\mysqljdbc.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\ojdbc14.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\postgresql-8.2-504.jdbc3.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\jtds-1.2.5.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\db2jcc.jar
      set CP=%CP%;%WEBAPPS_DIR%\konakart\WEB-INF\lib\db2jcc_license_cu.jar
      
      "%JAVA_HOME%\bin\java" -cp "%CP%"                            ^
      	com.konakartadmin.utils.CreateEnterpriseDB       ^
      	-p  "%WEBAPPS_DIR%/konakartadmin/WEB-INF/classes/konakartadmin.properties" ^
      	-h  "%INSTALL_DIR%"                              ^
      	-db %DBDIR%                                      ^
      	-ps %SHARED_PRODUCTS%                            ^
      	-c  %SHARED_CUSTOMERS%                           
      			
      rem
      rem  The "-d" parameter can be added to enable debugging.  This is useful if you 
      rem  have problems.
      rem