Deprecated feature

Example: Enabling multiple store archives for a sample store in a production environment

You can set up a sample store within your production environment to use multiple store enterprise (EAR) archives. You can use the multiple archives to separate store pages for specific components into one archive, with the store pages for the remaining components in another archive.

Before you begin

About this task

The sample store that is created for a production environment with the following steps is based on the Aurora extended sites store that is provided with Feature Pack 7. The steps use a store ID value of 715838534 for the Aurora Storefront Asset Store. If the store ID on your environment is different, replace the store ID with the value for your store ID.

These steps separate only order and payment store pages into a separated WAR file from remaining store pages. To separate a different store component into a new store WAR file, the EJB references, struts configuration, and code files that you need to move, change, or create are different.

Procedure

  1. In your development environment, export the store EAR files. For more information about exporting an EAR file, see Identifying and packaging J2EE assets for a single file.
  2. Transfer the exported EAR files to your production environment.
  3. Update the separated store EAR in your production environment with the contents of the exported store EAR file from your development environment that does not include the order and payment store assets. For more information about how to merge the assets in an exported EAR file into an EAR file in your production environment, see Deploying J2EE assets for an entire module.
  4. Install the new store EAR, WCStores1_demo, to the WebSphere Commerce instance in your production environment.
    1. Open the WebSphere Application Server administration console.
    2. Expand Applications and click New Application > New Enterprise Application.
    3. In the Preparing for the application installation pane, browse to the location for the WCStores1_demo EAR file from your development environment. Click NextNext.
    4. In the Select installation options pane, specify the following information for the options to installing this new enterprise application:
      Directory to install application
      WC_profiledir\installedApps\cell_name
      Application name
      WCStores1_demo
      File Permission
      .*\.war$=755#.*\.war/WEB-INF$=750#.*\.gif=755#.*\.js=755#.*\.swf=755#
      .*\.htm=755#.*\.html=755#.*\.png=755#.*\.bmp=755#.*\.css=755#.*\.jpg=755#
      .*\.doc=755#.*\.xls=755#.*\.ppt=755#.*\.ra=755#.*\.rpm=755#.*\.gz=755#
      .*\.pdf=755#.*\.ps=755#.*\.zip=755#.*\.gtar=755#.*\.tar=755#.*\.wav=755#
      .*\.jpe=755#.*\.jpeg=755#.*\.text=755#.*\.txt=755#.*\.mpg=755#.*\.mpeg=755#
      .*\.mov=755#.*\.avi=755#.*\.qt=755#.*\.wmv=755#.*DTDGenerator\.zip=750#
      .*loader/DB2Load\.zip=750#.*IdResGen\.zip=750#.*loader/Logger\.zip=750#
      .*loader/MassExtract\.zip=750#.*loader/MassLoader\.zip=750#
      .*loader/PropGen\.zip=750#.*loader/SAFServ\.zip=750#
      .*loader/TextTransformer\.zip=750#.*loader/WCALogger\.zip=750#
      .*loader/WCMCommon\.zip=750#.*loader/XMLTransformer\.zip=750#
      .*loader/dbconnect\.zip=750#.*payment/etillCal\.zip=750#.*\.WAR$=755#
      .*\.WAR/WEB-INF$=750#.*\.GIF=755#.*\.JS=755#.*\.SWF=755#.*\.HTM=755#
      .*\.HTML=755#.*\.PNG=755#.*\.BMP=755#.*\.CSS=755#.*\.JPG=755#.*\.DOC=755#
      .*\.XLS=755#.*\.PPT=755#.*\.RA=755#.*\.RPM=755#.*\.GZ=755#.*\.PDF=755#
      .*\.PS=755#.*\.ZIP=755#.*\.GTAR=755#.*\.TAR=755#.*\.WAV=755#.*\.JPE=755#
      .*\.JPEG=755#.*\.TEXT=755#.*\.TXT=755#.*\.MPG=755#.*\.MPEG=755#.*\.MOV=755#
      .*\.AVI=755#.*\.QT=755#.*\.WMV=755#.*\.def=750#.*\.DEF=750#
      .*lib/icu4j\.zip=640#.*zero$=755#.*appbuilder$=755
      Note: The preceding value is separated across multiple lines for readability. When you enter this value for the File Permission, enter the value as a single line.

      Select installation options window.

    5. In the Map modules to servers pane, include server1 and webserver1 in the Clusters and servers list. Select the Stores1 module.

      Map modules to servers options

    6. Click Next > Finish > Save directly to the master configuration
    7. Expand Applications > Application Types. Click WebSphere enterprise applications. In the list of available applications, click the WCStores1_demo application.
    8. In the Web Module Properties section, click Virtual hosts. Select the Stores1 module.

      Virtual hosts configuration for store application

    9. Expand Apply Multiple Mappings and change the virtual host for the application to be VH_demo. Click Apply.
  5. Update the struts configuration files in your environment to make sure that the store ID is correct for the Stores WAR in your production environment.
    1. Download and extract the following struts template for your original store WAR in a temporary folder.
    2. Copy the files in the extracted struts templates temporary folder.
    3. Go to the Stores\WebContent\WEB-INF directory.
    4. Add the copied files to the directory and override the existing struts configuration files.
  6. Update the struts configuration files in your environment to make sure that the store ID is correct for the WCStores1 WAR in your production environment.
    1. Download and extract the following struts template for your original store WAR in a temporary folder.
    2. Copy the files in the extracted struts templates temporary folder.
    3. Go to the Stores1\WebContent\WEB-INF directory.
    4. Add the copied files to the directory to create the struts configuration files.
  7. Configure the extended document root for your two store WAR files. The extended document root allows JSP file resources to be shared across WAR files.
    1. Go to the WC_profiledir/installedApps/cell_name/WCStores_instance_name.ear/Stores.war/WebContent/WEB-INF directory. Open the ibm-web-ext.xml file for editing.
    2. Update the development environment configuration for the store archive to use the path value for your production environment.
      Locate the following configuration:
       <jsp-attribute name="extendedDocumentRoot" value="workspace_dir/Stores1/WebContent"/> 
      
      Change the configuration to have the following value:
       <jsp-attribute name="extendedDocumentRoot" 
        value="WC_profiledir/installedApps/cell_name/WCStores1_instance_name.ear/Stores.war" /> 
    3. Go to the WC_profiledir/installedApps/cell_name/WCStores1_instance_name.ear/Stores1.war/WebContent/WEB-INF directory. Open the ibm-web-ext.xml file for editing.
    4. Update the development environment configuration for the store archive to use the path value for your production environment.
      Locate the following configuration:
       <jsp-attribute name="extendedDocumentRoot" 
        value="workspace_dir/Stores/WebContent"/> 
      
      Change the configuration to have the following value:
       <jsp-attribute name="extendedDocumentRoot" 
        value="WC_profiledir/installedApps/cell_name/WCStores_instance_name.ear/Stores.war" /> 
    5. Save and close the files.
      For more information about the extended document root property, see JSP engine configuration parameters.
  8. Update the configuration file for the web server to map the WebSphere Commerce store alias to the store WAR within each store EAR application:
    • IBM HTTP Server
      1. Go to the following directory:
        • For IBM i OS operating systemSolarisLinuxAIXWC_installdir/instance/instance_name/httpconf
        • WindowsWC_installdir\instance\instance_name\httpconf
      2. Open the httpd.conf configuration file for editing.
      3. Locate the web module mapping for the store modules and ensure that the mappings to point to the store WAR file in the webserver1 and server1 applications.
    • Sun ONE web server
      1. Locate and open the obj.conf web server configuration file for editing.
      2. Locate the web module mapping for the store modules and ensure that the mappings to point to the store WAR file in the webserver1 and server1 applications.
    • WindowsInternet Information Services (IIS) Manager web server

      In the IIS Manager, change the value for the physical path to the WebSphere Commerce store module to point to the store WAR file in the webserver1 and server1 applications.

  9. Regenerating the WebSphere Application Server Web server plug-in configuration file.
  10. Enable multiple store WAR files for your WebSphere Commerce instance in the wc-server.xml for your site:
    1. Go to the WC_eardir/xml/config directory and open the wc-server.xml file for editing.
    2. Search for StoreWebModuleName="Stores" in the file. Add the configuration MultipleStoreWARs="true" to the file
      For example,
      <Instance
        ...
        StoreWebModuleName="Stores"
        MultipleStoreWARs="true"
        .../>
    3. Save and close the file. You must republish the WebSphere Commerce application before the change takes effect.
    4. Optional: If the new store module has its own parameters, register new WAR file in WebSphere Commerce by adding the new web modules into the wc-server.xml file.
      For example,
      <Module contextPath="/webapp/wcs/stores1" fileServletEnabled="false" 
       name="Stores1" urlMappingPath="/servlet" webAlias="/wcsstore">
        <InitParameters adapters="XML/HTTP, BrowserAdapter" 
         contextSetName="Store" handleDoubleClick="true"/>
        <URLRedirectFilter enable="false"/>
      </Module>
  11. Update the shared library for the separated store archive environment to include the resource bundles that your new store archive needs to access.
    1. In the WebSphere Application Server, expand Environment. Click Shared libraries.
    2. Click the shared library that you need to update. The General Properties for the library open.
    3. Add the following directory and files to the list of class paths.

      Store_archivedir/WEB-INF/classes

    4. Remove the following class paths from the shared library
      • Store_archivedir/WEB-INF/base.tld
      • Store_archivedir/WEB-INF/coremetrics.tld
      • Store_archivedir/WEB-INF/flow.tld
      • Store_archivedir/WEB-INF/stores.tld
      • Store_archivedir/WEB-INF/wcfSSFS.tld
      • Store_archivedir/WEB-INF/wcpgl.tld
      • Store_archivedir/WEB-INF/json.tld
    5. Click Apply > Save directly to the master configuration.
  12. Change the file permission of the two store archives for the sample store.
    To change the file permission of the WCStores1_demo.ear and WCStores_demo.ear archives by running the following commands in a command-line utility:
    • chmod 755 WC_profiledir/installedApps/WC_demo_cell/WCStores_demo.ear
    • chmod 755 WC_profiledir/installedApps/WC_demo_cell/WCStores1_demo.ear
  13. Restart the server1 and webserver applications.
  14. Open your store and complete a shopping flow to verify that your store functions correctly.