Setting the Web Application of an Extension
An extension in SAP Commerce optionally has a web application, that is, a functional part accessible via a web browser.
By default (that is, as generated by the extension generator extgen), the URL part of a web application of an extension is the name of the extension. By consequence, the factory default for a web application to be reachable is http://${server}:${serverport}/${extensionname} (http://localhost:9001/storefoundation or http://myserver.com:80/myshop, for example).
Many application servers allow access control on URL patterns. This allows you to set up access profiles for individual web applications in SAP Commerce based on criteria such as IP ranges. For example, you may want the storefront to be available to anyone, but only users from the local network should be able to reach the SAP Commerce Administration Console.
Setting the Webroot Path of an Extension
To set the webroot path for an extension's web application modify the local.properties file to contain a property according to this pattern: ${extensionname}.webroot=/${path}, such as:
hac.webroot=/admin storefoundation.webroot=/storefoundation
See Configuring the Behavior of SAP Commerce for further information.
hac.webroot=<disabled>
For information about setting extension web paths in containerized Platform image aspects, see Image Aspects
Changing the Default Web Application
The default web application of SAP Commerce is the web application that is launched if no web application is specified ( http://localhost:9001 or http://myserver.com:80, for example). By factory default, the SAP Commerce Administration Console is the default web application. It is provided by the hac extension; for details see Administration Console.
The SAP Commerce Administration Console is a critical web application because it provides important functionality, for example the initialization of SAP Commerce. Thus, SAP strongly recommends configuring the SAP Commerce Administration Console not to be the default web application on live systems.
To change the default web application from the SAP Commerce Administration Console provided by the hac extension to any other extension:
-
To set the Administration Console to no longer be the default web application, add a line to the local.properties file, such as:
hac.webroot=/admin
-
To set another extension to be the default web application, add a line to the local.properties file that makes the web application of the new extension the default. The exact value may be application-server-specific. For example, to deploy on the Apache Tomcat (be it on the SAP Commerce Server or be it on a stand-alone installation), you need to set the value to null, such as:
myextension.webroot=
-
Build SAP Commerce
-
Open a command shell.
-
Navigate to the <${HYBRIS_BIN_DIR}> /platform directory.
-
Make sure that a compliant Apache Ant version is used:
-
On Windows systems, call the <${HYBRIS_BIN_DIR}> /platform/setantenv.bat file. Do not close the command shell after this call as the settings are transient and would get lost if the command shell is closed.
-
On Unix systems, call the <${HYBRIS_BIN_DIR}> /platform/setantenv.sh file, such as: . ./setantenv.sh
-
-
Call ant clean all to build SAP Commerce.
-