Technote

(FAQ)
How to change the default ports for the store front
How do you change the default ports for the store front in WebSphere Commerce 6.0? Some configuration is required to change the default ports on which the WebSphere Commerce Server listens. The default ports for the store front are 80 for HTTP and 443 for HTTPS, but these can be customized.


Answer

The example below describes the steps to change the HTTP and HTTPS ports from 80 and 443 to 8080 and 8443 respectively.

  1. Edit the httpd.conf file in the <WC>/instances/<instance>/httpconf directory.

    1. Locate "Listen <hostname>:80" and "<VirtualHost <hostname:80>" and replace with  "Listen <hostname>:8080" and "<VirtualHost <hostname:8080>" respectively.

    2. Locate "Listen <hostname>:443" and "<VirtualHost <hostname:443>" and replace with  "Listen <hostname>:8443" and "<VirtualHost <hostname:8443>" respectively.

      After the file is edited, it should look approximately like this:

      ########## IBM WebSphere Commerce (Do not edit this section) - Any changes made may be overridden at any time #################
      #Instance name : demo

      Listen 8080
      <VirtualHost myhost:8080>
      ServerName myhost.com
      Alias /wcsstore "C:\WebSphere\AppServer\installedApps\myhost\WC_demo.ear/Stores.war"
      Alias /wcs "C:\WebSphere\AppServer\installedApps\myhost\WC_demo.ear/CommerceAccelerator.war"
      </VirtualHost>

      Listen 8443
      <VirtualHost myhost:8443>
      Keyfile "C:\WebSphere\IBMHttpServer\ssl\keyfile.kdb"
      SSLEnable
      SSLClientAuth 0
      ServerName myhost.com
      Alias /wcsstore "C:\WebSphere\AppServer\installedApps\myhost\WC_demo.ear/Stores.war"
      Alias /wcs "C:\WebSphere\AppServer\installedApps\myhost\WC_demo.ear/CommerceAccelerator.war"

  2. Ensure that virtual hosts exist in WAS Administration Console for these two new ports on your WC_instance server:

    1. Open the WAS Administration Console.

    2. Click Environment.

    3. Click Virtual Hosts.

    4. Click the virtual host for your WebSphere Commerce Server (VH_instance).

    5. Under Additional Properties, click Host Aliases.

    6. Ensure that a host name and port combination exists for both of the HTTP and HTTPS ports for your server. If one is missing, click New and then add in the host name and port for your WebSphere Commerce Server, then click Save. (That is, change the two entries for port 80 to 8080, and the two entries on port 443 with 8443.)

  3. Edit the <WC>/instances/<instance>/xml/<instance>.xml file.

    1. Under the <WebServer .... > section, change ServerPort to point to the new HTTP port (8080) and add SSLPort to point to the new HTTPS/SSL port (8443):

          <WebServer AdminPort="8002"
                     AuthenticationMode="Basic"
              .......
                     ServerPort="8080"
              SSLPort="8443"

      Locate the following entries and add in the SSLPort there too:

              <Module contextPath="/webapp/wcs/stores"
                      fileServletEnabled="false"
                      name="Stores"
                      urlMappingPath="/servlet"
                      webAlias="/wcsstore">
                <InitParameters adapters="XML/HTTP, BrowserAdapter"
                                contextSetName="Store"
                                SSLPort="8443"
                                handleDoubleClick="true" />
              </Module>

  4. Run config_ant.sh to propagate the instance.xml changes to wc-server.xml (http://publib.boulder.ibm.com/infocenter/wchelp/v6r0m0/index.jsp?topic=/com.ibm.commerce.admin.doc/tasks/tcmxml.htm).

  5. Change the Application server port preference:

    1. In the WebSphere Administration Server Administration Console, select Servers.

    2. Select Web Servers.

    3. Select Webserver 1.

    4. Select Additional Properties > Plug-in properties.

    5. Select Request and Response.

    6. Select Application server port preference.

    7. Change from 'Host header' to 'WebServer port'  (this change modifies the webserver1/server.xml file).

  6. Regenerate the XML plug-in (plugin-cfg.xml) through the WAS Administration Console:

    1. Open the WAS Administration Console.

    2. Find the webserver named 'webserver1' and click the check mark beside it.

    3. Click Generate plugin config.

  7. Restart webserver1 and server1, and access the store at http://<host>:8080. Clicking on a secure link will redirect you to https://<host>:8443.

Cross Reference information
Segment Product Component Platform Version Edition
Commerce WebSphere Commerce - Express Customization / Application Development i5/OS, Linux, Windows 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4
Commerce WebSphere Commerce Professional Edition Customization / Application Development AIX, i5/OS, Linux, Solaris, Windows 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4
Commerce WebSphere Commerce Developer Enterprise Customization / Application Development Windows 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4
Commerce WebSphere Commerce Developer Professional Edition Customization / Application Development Windows 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4
Commerce WebSphere Commerce Developer Express Customization / Application Development Windows 6.0, 6.0.0.1, 6.0.0.2, 6.0.0.3, 6.0.0.4
   

Document Information

Current web document: http://www.ibm.com/support/docview.wss?uid=swg21248447