Administer > Deploy > Deploying customized assets > Customized WebSphere Commerce Web server assets
Update static Web assets to a remote Web server
Overview
Several tools in the WebSphere Commerce, such as Administration Console, allow you to add or change content in the enterprise application.
Store publishing, for example, adds assets such as...
- JSP files
- property files
- image files
These assets are made available to either the application server or the Web server.
- If the Web server is on the same system as the enterprise application, the assets are readily available to the Web server.
- If the Web server is on a system remote from the enterprise application, then transfer the static Web assets.
Transfering static Web assets to a remote Web server can be done using an FTP or file copy function.
- The file copy function can be used only if the WebSphere Commerce system is not part of a cluster.
- The FTP method can be used if Commerce is part of a cluster and can happen on a staging server or a live server running Commerce.
In a clustered environment, each node which runs the WebSphere Commerce application can use the FTP method to the FTP server machines (web server machines).
Procedure
- Determine if an implementation has already been specified for the interface. Run the following SQL query:
select * from cmdreg where interfaceName='com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentCmd'
- If an implementation is specified, run one of the following...
FTP...
update cmdreg set className='com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentUsingFTPCmdImpl' where interfaceName='com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentCmd';
FileSystemCopy...
update cmdreg set className='com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentUsingFileSystemCmdImpl' where interfaceName='com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentCmd';If an implementation is not specified, run one of the following...
FTP...
insert into cmdreg (storeent_id,interfacename,description,classname) values (0, 'com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentCmd', 'FTP implementation for UpdateStaticEARContentCmd', 'com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentUsingFTPCmdImpl');
FileSystemCopy...
insert into cmdreg (storeent_id,interfacename,description,classname) values (0, 'com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentCmd', 'FileSystemCopy implementation for UpdateStaticEARContentCmd', 'com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentUsingFileSystemCmdImpl');
The storeend_id value must be set to 0 because the command is only applicable as a site administrator task.
- Additional updates are required. Select a file transfer function and complete the updates.
- Use the FTP method:
The FTP service should be configured on the Web server node.
- Open the file: WC_EAR/xml/config/FTP.xml.
- Create a copy of the file in a temporary location on your system. Ensure the file is stored in Temp_dir/xml/config/FTP.xml.
- Edit the Temp_dir/xml/config/FTP.xml file and provide values for the following attributes:
- proceedOnlyWhenAllServersAreWorking
- Set this value to false. This attribute is only applicable to the root element of FTP servers.
- FTPServerFTPHost
- The fully qualified host name of the remote Web server system. The application server must be able to access this host name. Ensure that any configured firewalls allow FTP communication between the Web server and application server systems.
- FTPPort
- The port of the FTP server. If the port is not specified, a default port of 21 is used.
- FTPUser
- A user to connect to the FTP server. Ensure the logon directory for this user has the same value as the FTPTargetDir attribute.
- FTPPassword
- The encrypted password of the FTP user. Use the wcs_encrypt utility to encrypt the password.
- FTPTargetDir
- The directory on the Web server system that represents the wcsstore alias. This is the directory in which static content is placed.
For example, on an IBM HTTP Server, the directory name is determined by completing these steps on the Web server system:
- Open the httpd.conf file found...
- WC_INSTALL/instances/instance/httpconf
- WC_USER/instances/instance/httpconf
- In the httpd.conf file, search for wcsstore. An alias entry should exist. An example of the line:
- Alias /wcsstore "temp/filehold/Stores.war"
- Record the full directory. In this example, the directory is temp/filehold/Stores.war. Enter this directory for the FTPTargetDir attribute.
- Ensure the value for the FTPTargetDir attribute is the same as the FTPUser logon directory.
- Save the changes to the WC_EAR/xml/config/FTP.xml file. Continue to step 6.
- Use the FileSystemCopy method:
- Locate the file: WC_EAR/xml/config/FileSystem.xml.
- Create a copy of the file in a temporary location on your system. Ensure the file is stored in Temp_dir/xml/config/FileSystem.xml.
- Edit the Temp_dir/xml/config/FileSystem.xml file and provide values for the following attributes:
An example of the FileSystem.xml file:
- proceedOnlyWhenAllServersAreWorking
- Set this value to false. This attribute is only applicable to the root element of FTP servers.
- FSLocation
- A local directory on the WebSphere Commerce system which is mapped or mounted to a remote directory on the Web server system.
To determine the FSLocation:
- On the Web server system open up file:
- WC_INSTALL/instances/instance/httpconf/httpd.conf
- WC_USER/instances/instance/httpconf/httpd.conf
- Within the httpd.conf file, search for a line similar to:
Alias /wcsstore "temp/filehold/Stores.war"Record this directory but remove Stores.war . In this example, the FSLocation directory is: temp/filehold.
- On the WebSphere Commerce system, map or mount the directory from step 5.c.ii to a local drive or directory. Use this local drive or directory as the value for FSLocation.
<FSLocations xmlns="http://www.ibm.com/xmlns/prod/WebSphereCommerce" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/WebSphereCommerce xsd/FileSystem.xsd" proceedOnlyWhenAllServersAreWorking="false"> <FSLocation dir="/temp/filehold"/> </FSLocations>
- Save the changes to the WC_EAR/xml/config/FileSystem.xml file. Continue to step 6.
- To specify what files are flagged as static content, review and update the UpdateEARFilter.properties file. Complete the following steps:
- Open the following file and review the contents:
- WC_EAR/properties/com/ibm/commerce/wc/appmanagement/properties/UpdateEARFilter.properties
- In the sample file, name value pairs are defined. If an extension is flagged true, any file with this specific extension is treated as static content. This sample file indicates that any file with an extension of .gif is static content.
#------------------------------------------------------------------- # Licensed Materials - Property of IBM # # WebSphere Commerce # # (c) Copyright IBM Corp. 2006 # # US Government Users Restricted Rights - Use, duplication or # disclosure restricted by GSA ADP Schedule Contract with IBM Corp. #------------------------------------------------------------------- # .gif=true .jpg=true .js=true .swf=true .GIF=true .JPG=true .JS=true .SWF=true
- If update or specify additional name value pairs...
- Create a UpdateEARFilter.properties file that stores the updated or additional name value pairs. Verify the file is stored in file:Temp_dir/properties/extensions/appmanagement/UpdateEARFilter.properties The contents of this file are merged with the file version in step 6.a.
- Follow the sample file in step 6.b to update the new UpdateEARFilter.properties file with name value pairs following these guidelines:
- Extensions flagged as true are considered static content. Extensions flagged as false are non-static content.
- If you are adding custom value pairs ensure that you add an entry for uppercase and lowercase.
- Configuration is complete. When updating the content using the WebSphere Application Server administrative console, the static assets are automatically transferred to the remote Web Server. The following example demonstrates updating a logo using WebSphere Commerce Accelerator.
- Prepare a GIF image to use as the store logo file.
- Launch the Accelerator tool and select the store where you want the new logo to appear.
- Click Store. Click Upload. The upload page is displayed.
- Click Browse. Select the logo file that you prepared.
- Click Upload.
- Click Apply.
- Navigate to the location specified in FTP.xml or FileSystem.xml to view the new logo file.
- Create a compressed file to use for deploying the changes to the application server:
- Create a compressed file with name tempzip in the Temp_dir directory.
- Add the files you created in step 6.c and in step 4 or 5 to the file: Temp_dir/tempzip.
- To deploy the changes, complete the following steps:
- Open the WebSphere Application Server administrative console.
- Click Applications > Enterprise Application.
- Select WC_instance. Click Update.
- Click Replace, add, or delete multiple files. Click Local file system.
- In Local file system enter the name of the compressed file you created in step 8.b. For example enter Temp_dir/tempzip.
- Click Next. Click OK.
- After the update completes, click Save to Master Configuration. Click Save.
What to do next
Restart the WebSphere Commerce application:
- Start and stop an application server on AIX, Linux, and Solaris operating system
- Start and stop an application server on i5/OS
- Select one of the following methods:
- Start and stop an application server from the Windows Services panel
- Start and stop an application server from a Windows command prompt
.
Previous topic: Validate changes have been deployed for a custom Web server