Configuring the WebSphere Commerce Search web server

You can configure the WebSphere Commerce Search web server by using IBM HTTP Server (IHS) or another web server product.

When the search service is required to be exposed to the outside world, it is recommended to have a web server for the search cluster for security reasons. This recommendation is consistent with the recommendations for the WebSphere Commerce cluster. When the web server is placed in the DMZ, it provides a level of protection and isolation. User requests do not directly hit a layer where the code resides, so even if this layer is compromised, the damage is limited to only the information residing on the web server.

Important: This task must be performed when you enable WebSphere Commerce Search.
The following configuration options are available, depending on your web server:
  • You can manually update the web server configuration for IBM HTTP Server (IHS). This is done by creating the WebSphere Commerce Search web server's httpd.conf file, adding a directive to listen on the search virtual host port, and ensuring that the web server plug-in is installed on the web server host.
  • Or, you can automate updating the web server configuration when you use IBM HTTP Server (IHS). This is done by optionally passing in extra configuration parameters when you run the enablement scripts.
    Important: The automated web server configuration supports IBM HTTP Server (IHS) only. That is, it does not support or include steps for configuring non-IHS web servers such as IIS and SunOne. For other types of web servers, consult the documentation that is provided by the web server vendor to update the configuration.
    This approach includes the following considerations:
    • The WebSphere Commerce Search web server's httpd.conf file is automatically created.
    • You can set up a valid configuration where the WebSphere Commerce Search and WebSphere Commerce web servers have separate configuration files. That is, you are not required to manually update the plugin-cfg.xml files.
    • You are not required to install another copy of IBM HTTP Server. The same installation can be shared with the WebSphere Commerce web server, if preferred.

      A second IHS process is started to handle search HTTP requests if you use the same IHS installation. This process ensures that the configurations do not collide, and eases configuration and maintenance.

  • For configuring non-IHS web servers such as IIS and SunOne, consult the provided documentation to update the configuration.

Procedure

  • To manually update the web server configuration:

    The Solr application must use a separate web server; a shared web server is not supported. Therefore, you must configure another web server that listens on the search virtual host port (default is port 3737) and point to the Solr profile plug-in configuration file (plugin-cfg.xml). If the new web server is set to run on the same host as the WebSphere Commerce web server, then be careful to avoid any port conflicts. Ensure that the new web server is not also listening on the ports such as port 80.

    The following ports are used for administration purposes and should be blocked by a firewall to avoid external access to administrative tools:

    Default port numbers

    WebSphere Commerce tool Field Default port number
    WebSphere Commerce Accelerator WC Accelerator Port 8000
    Administration Console WC Admin Port 8002
    Organization Administration Console WC OrgAdmin Port 8004
    WebSphere Commerce Preview WC Preview port 8006
    WebSphere Commerce Preview WC Preview port 8007
    Search Preview Servlet Search preview servlet port 3738 (SSL)

    If you previously configured a web server to be shared by a WebSphere Commerce instance and WebSphere Commerce Search, you can follow the instructions in the support document 7021944 to change the configuration to separate web servers.

    You can identify your search server by using the following default values:
    • The profile name is instance_name_solr
    • The application server name is solrServer
    • The web server definition name is solrWebserver
    • The application name is Search_instance_name
    Note: The following configuration steps do not include the steps for configuring non-IHS web servers such as IIS and SunOne. For other types of web servers, consult the provided documentation to update the configuration.
    1. Complete the Deploying the WebSphere Commerce Search server locally in the standard configuration enablement script step, as outlined in the task.
    2. For IBM HTTP Server, open the configuration file httpd.conf
    3. Add a directive to listen on the search virtual host port (default is port 3737).
      For example: Listen host_name:3737
    4. Add a directive to listen on the search preview servlet host port (default is SSL port 3738).
      For example: Listen host_name:3738
    5. Ensure that the web server plug-in is installed on the web server host. If needed, it can be installed from your WebSphere Application Server installation media. For more information, see Installing and configuring Web server plug-ins.
    6. The following snippet is a sample update to the httpd.conf file:
      LinuxAIX
      Listen <hostname>:3737
      LoadModule was_ap22_module "$PLUGIN_INSTALL_DIR_VAR$/bin/64bits/mod_was_ap22_http.so"
      WebSpherePluginConfig "$PLUGIN_INSTALL_DIR_VAR$/config/solrWebserver/plugin-cfg.xml"
      
      KeyFile "$PLUGIN_INSTALL_DIR_VAR$/config/solrWebserver/keyfile.kdb"
      Listen <hostname>:3738
      LoadModule ibm_ssl_module modules/mod_ibm_ssl.so
      <VirtualHost  <hostname>:3738>
      SSLEnable
      SSLProtocolDisable SSLv2
      SSLClientAuth 0
      ServerName  <hostname>
      </VirtualHost>
      Windows
      Listen <hostname>:3737
      LoadModule was_ap22_module "$PLUGIN_INSTALL_DIR_VAR$\bin\32bits\mod_was_ap22_http.dll"
      WebSpherePluginConfig "$PLUGIN_INSTALL_DIR_VAR$\config\solrWebserver\plugin-cfg.xml"
      
      KeyFile "$PLUGIN_INSTALL_DIR_VAR$\config\solrWebserver\keyfile.kdb"
      Listen <hostname>:3738
      LoadModule ibm_ssl_module modules\mod_ibm_ssl.so
      <VirtualHost  <hostname>:3738>
      SSLEnable
      SSLProtocolDisable SSLv2
      SSLClientAuth 0
      ServerName  <hostname>
      </VirtualHost>

      Where $PLUGIN_INSTALL_DIR_VAR$ is the WebSphere plug-in installation directory (default is IHS_dir/Plugins). Where solrWebserver is the name for the web server definition that is created in Step 4.

    7. Restart your web server.
    8. Complete the remaining Deploying the WebSphere Commerce Search server locally in the standard configuration task steps.
  • To automate the web server configuration:
    1. Begin the Deploying the WebSphere Commerce Search server locally in the standard configuration enablement script step, as outlined in the task.
    2. Include the following search_server_config optional parameters when you run the enablement script:

      [-DautoConfigSearchWebserver=true] [-DisShareWCWebserverProduct=true|false] [-DsearchWebserverHostname=searchWebserverHostname] [-DsearchWebserverOS=searchWebserverOS] [-DsearchWebserverInstallLocation=searchWebserverInstallLocation] [-DsearchPluginInstallLocation=searchPluginInstallLocation] [-DsearchRemoteConfigPath=searchRemoteConfigPath] [-DsearchIsConfigViaFTP=true|false] [-DsearchFtpServerPort=searchFtpServerPort] [-DsearchFtpUserId=searchFtpUserId] [-DsearchFtpUserPwd=searchFtpUserPwd] [-DsearchIsConfigViaNFS=true|false] [-DsearchMappedConfigPath=searchMappedConfigPath] [-DsearchPort=searchPort]

      Where:
      autoConfigSearchWebserver
      The flag that turns on or off the automation. It indicates whether to automatically configure the IHS web server. The default value is false.
      If set to false, or if not specified in the script, you must manually configure your search web server.
      isShareWCWebserverProduct
      Indicates whether the IHS server is shared with WebSphere Commerce. The default value is false.
      If set to true, the proceeding parameter values are automatically retrieved. However, you must specify the FTP password, as it is not typically stored on disk for security purposes.
      If set to false, or if the required value is not recorded in the WebSphere Commerce instance's configuration files, you must manually configure your search web server using the proceeding parameter values.
      searchWebserverHostname
      The fully qualified host name for the WebSphere Commerce Search web server.
      This parameter is required when:
      • Automatically configuring an IHS web server (autoConfigSearchWebserver=true), and
      • Using a separate IHS install (isShareWCWebserverProduct=false or not set).
      When the parameter is required but not set, the search deployment does not proceed.
      searchWebserverOS
      Indicates which operating system is used on the search web server host.
      If not specified, it defaults to the same operating system as the WebSphere Commerce web server host. That is, the value of the WebSphere Commerce web server property webserverOS is used.
      You must set this property if you set isShareWCWebserverProduct to false and your search web server host uses a different operating system than the WebSphere Commerce web server host.
      The allowed values are: aix, linux, os400, or windows. The values are case-sensitive.
      searchWebserverInstallLocation
      The WebSphere Commerce Search installation location.
      This parameter is required when:
      • Automatically configuring an IHS web server (autoConfigSearchWebserver=true), and
      • Using a separate IHS install (isShareWCWebserverProduct=false or not set).
      When the parameter is required but not set, the search deployment does not proceed.
      searchPluginInstallLocation
      The WebSphere Commerce Search plug-in installation location. This parameter is required when you use a separate IHS installation.
      This parameter is required when:
      • Automatically configuring an IHS web server (autoConfigSearchWebserver=true), and
      • Using a separate IHS install (isShareWCWebserverProduct=false or not set).
      When the parameter is required but not set, the search deployment does not proceed.
      searchRemoteConfigPath
      The path on the remote IHS machine where the WebSphere Commerce Search web server's file is stored.
      This must be the fully qualified path to the directory where the search web server configuration files are to be kept. The value is used to define properties in the search web server's httpd.conf file such as the document root and log file location. The value is also used when you transfer files over FTP.
      You can transfer the IHS configuration files to the remote web server when:
      • Automatically configuring an IHS web server (autoConfigSearchWebserver=true), and
      • Using a remote web server (the files must be copied to the remote machine).
      You can specify how the web server configuration files (httpd.conf and plugin-cfg.xml) are transferred to the remote machine. The following options are available:
      • Copy files over FTP.
      • Copy files over a locally mapped or mounted drive.
      If neither option is set to true, the scripts do not attempt to transfer the configuration files.
      searchIsConfigViaFTP
      Indicates whether to transfer the configuration files over FTP.
      When set to true, the value of searchRemoteConfigPath is used to specify the path that the files are copied. Files and directories are created under the searchRemoteConfigPath/instance_name_solr directory.
      Important: The files and directories are created over FTP and are therefore created relative to the root of the FTP server. If the FTP server root directory is not changed to the root of the remote file system, you must move the files to the appropriate location. That is, copy them from remoteFTPServerRoot/searchRemoteConfigPath to searchRemoteConfigPath, where remoteFTPServerRoot is the directory of the root of the FTP server. For example, it is the path after you log in to the FTP server and change the current directory to root: cd /.
      The FTP parameters include:
      searchFtpServerPort
      The WebSphere Commerce Search FTP server port.
      searchFtpUserId
      The WebSphere Commerce Search FTP user ID.
      searchFtpUserPwd
      The WebSphere Commerce Search FTP user password.
      The default value is false.
      searchIsConfigViaNFS
      Indicates whether to transfer the configuration files over a locally mapped or mounted drive.
      The mapped parameters are:
      searchMappedConfigPath
      The directory to which the search web server configuration files are copied.
      Files and directories are created under the searchMappedConfigPath/instance_name_solr directory.
      If you use NFS to transfer the web server file, ensure that the value of the searchMappedConfigPath parameter matches the value of the searchPluginInstallLocation parameter.
      The default value is false.
      searchPort
      The WebSphere Application Server virtual host port number to listen on for the WebSphere Commerce Search application.
      The value must be a valid and available TCP port.
      The default value is 3737.
      Examples
      The following examples outline the typical scenarios when you configure the WebSphere Commerce search web server:
      Replace [search_server_config] in the command line with the following parameter if you are:
      • Not using the automated IHS web server configuration.
      
      -DautoConfigSearchWebserver=false
      
      Replace [search_server_config] in the command line with the following parameters if you are:
      • Using the automated IHS web server configuration,
      • Sharing the IHS from your WebSphere Commerce instance, and
      • Your IHS is local.
      
      -DautoConfigSearchWebserver=true -DisShareWCWebserverProduct=true
      
      Replace [search_server_config] in the command line with the following parameters if you are:
      • Using the automated IHS web server configuration,
      • Sharing the IHS from your WebSphere Commerce instance,
      • Your IHS is remote, and
      • Your WebSphere Commerce web server does not use FTP or NFS for remote configuration. Or your WebSphere Commerce web server uses NFS for remote configuration and the NFS mount is in place.
      
      -DautoConfigSearchWebserver=true -DisShareWCWebserverProduct=true
      
      Or, if your WebSphere Commerce web server uses FTP for remote configuration:
      
      -DautoConfigSearchWebserver=true -DisShareWCWebserverProduct=true -DsearchFtpUserPwd=your_FTP_password
      
      Where your_FTP_password is the password for the FTP server that is running on your IHS web server host.
      Or, when you want to ensure that FTP or NFS is not used for remote configuration:
      
      -DautoConfigSearchWebserver=true -DisShareWCWebserverProduct=true -DsearchIsConfigViaFTP=false -DsearchIsConfigViaNFS=false
      
      Replace [search_server_config] in the command line with the following parameters if you are:
      • Using the automated IHS web server configuration,
      • Using a separate IHS,
      • Your IHS is remote, and
      • You are not automatically transferring the files to the remote machine.
      
      -DautoConfigSearchWebserver=true -DisShareWCWebserverProduct=false 
      -DsearchWebserverHostname=yourSearchIHSHostName 
      -DsearchWebserverInstallLocation=thePathToIHSInstallDirOnYourSearchIHSHost 
      -DsearchPluginInstallLocation=thePathToPluginInstallDirOnYourSearchIHSHost 
      -DsearchRemoteConfigPath=pathWhereSearchIHSConfigFilesWillReside
      
      For example:
      
      -DautoConfigSearchWebserver=true -DisShareWCWebserverProduct=false 
      -DsearchWebserverHostname=search.example.com 
      -DsearchWebserverInstallLocation=/usr/IBM/WebSphere/HTTPServer 
      -DsearchPluginInstallLocation=/usr/IBM/WebSphere/HTTPServer/Plugins 
      -DsearchRemoteConfigPath=/usr/IBM/WebSphere/HTTPServer/solrHttpConf1
      
    3. Complete the remaining steps in:
    4. If your IHS is on a remote host, you must manually ensure that the web server plug-in is installed on the web server host. If needed, it can be installed from your WebSphere Application Server installation media. For more information, see Installing and configuring Web server plug-ins.

Results

After you run the automated web server configuration, the WebSphere Commerce Search web server's httpd.conf file is automatically created in the following location:
  • The httpd.conf file is initially created in WC_installdir/components/foundation/subcomponents/search/deploy/ihsconf/solrProfileName/httpd.conf.
    • If you are using a local IHS web server (on the same machine as WebSphere Commerce), the final version of the httpd.conf file is created in WC_installdir/instances/instance_name/search/solr/home/httpconf/httpd.conf.
    • If you are using a remote IHS web server and use either the searchIsConfigViaFTP or searchIsConfigViaNFS option to copy the file to the remote server, the httpd.conf file is copied to the searchRemoteConfigPath path that you specified.