Configuring FTP or file system copy for extracting managed assets
This task describes the method by which FTP or the file system copy function
can be configured to extract managed web assets from the HCL Commerce database to a file
system. After you complete this task, static content is extracted and moved by using the specific
file transfer method, and is no longer deployed to the HCL Commerce EAR.It is
recommended that site administrators configure one of the following methods to maintain WebSphere
Commerce performance in a production environment. For more information, see Managed asset deployment.
Procedure
-
Determine whether an implementation is specified for the interface. Run the following SQL
query:
select * from cmdreg where interfaceName='com.ibm.commerce.wc.appmanagement.commands.UpdateStaticEARContentCmd'
-
Complete one of the following actions:
- If an implementation is specified, choose one of the file transfer methods and run the command:
- 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, choose one of the file transfer methods and run the command:
- 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');
Note: The storeend_id value must be set to 0 because the command is only applicable as a site administrator task. - If an implementation is specified, choose one of the file transfer methods and run the command:
-
Configure the file transfer function selected:
- For FTP:
The FTP service must be configured on the web server node.
Note: If you are using the FTP method, FTP server software that is not fully compliant with the FTP standard (RFC 959) might not work correctly.- Locate the file: WC_eardir/xml/config/FTP.xml.
- Create a backup of the file in a temporary location on your system.
- Edit the WC_eardir/xml/config/FTP.xml file and provide
values for the following attributes. If you plan to use Quick Publish, then you need set values for
the
<FTPServer>
and<ProdFTPServer>
attributes. Otherwise, you need to only specify a value for the<FTPServer>
attribute.- proceedOnlyWhenAllServersAreWorking
- Set this value to false. This attribute is only applicable to the root element of FTP servers.
- FTPHost
- 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.
- 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 that the logon directory for this user has the same value as the FTPTargetDir attribute.
- FTPPassword
- The encrypted password of the FTP user. Encrypt the password with the wcs_encrypt utility, without specifying the merchant key.
- FTPTargetDir
- The directory on the web server system that represents the
wcsstore
alias. This is the directory in which static content is placed.For instance, on an IBM HTTP Server, the directory name is determined by completing these steps on the web server system:- Open the httpd.conf file that is found in the following directory:
- WC_installdir/instances/instance_name/httpconf/
WC_userdir/instances/instance_name/httpconf/
- In the httpd.conf file, and search for a line similar
to:
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.
An example of the FTP.xml file:<FTPServers 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/FTP.xsd" proceedOnlyWhenAllServersAreWorking="false"> <FTPServer FTPHost="" FTPPort="" FTPUser="" FTPPassword="" FTPTargetDir="" /> <ProdFTPServer FTPHost="" FTPPort="" FTPUser="" FTPPassword="" FTPTargetDir="" /> </FTPServers>
Note: If you are on HCL Commerce Version 8.0.0 Fix Pack 5 or earlier, you might not see the<ProdFTPServer>
block. Add the attribute if needed. - Open the httpd.conf file that is found in the following directory:
- Save the changes to the WC_eardir/xml/config/FTP.xml file.
- Update the master configuration file so that changes are not lost with the next deployment.
- For file system copy:Note: If you are using the Windows mapped drive feature with Windows hosting both local and remote systems, ensure that security configurations allow for activities such as accessing remote folders and locally mapped drives for the following accounts:
- Local service
- Network service
- System service
- Locate the file: WC_eardir/xml/config/FileSystem.xml.
- Create a backup of the file in a temporary location on your system.
- Edit the WC_eardir/xml/config/FileSystem.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.
- FSLocation (and ProdFSLocation)
- A local directory on the HCL Commerce system that is mapped or mounted to a remote directory on the web server system.
- Save the changes to the WC_eardir/xml/config/FileSystem.xml file.
- Update the master configuration file so that changes are not lost with the next deployment.
- For FTP:
-
To specify what files are flagged as static content, review and update the
UpdateEARFilter.properties file. Complete the following steps:
Results
What to do next
- Set the transfer frequency values for your managed web assets. For more
information about changing these values, see Changing managed file HCL Commerce EAR updater parameters. Due to the reduced load of uploading assets to the HCL Commerce EAR, the
frequency of uploading assets can be increased through setting lower values of the following
variables:
minNumOfFileForUpdate=1 minSecFromLastUpload=300
- Restart the HCL Commerce application.