Install Headless Services using the package .zip file
The procedure for installing the Headless Services module using a package .zip file depends on your Sitecore environment:
-
On a standalone Sitecore instance or, in a scaled environment, on the CM instance, you must install Sitecore Headless Services.
-
For scaled Sitecore installations (production environments with separate CM and CD servers), you must configure the CD instance in a scaled Sitecore environment.
Install Sitecore Headless Services
On a Standalone Sitecore instance or, in a scaled environment, on the CM instance, you must install Sitecore Headless Services only once in a Sitecore headless environment.
To install Sitecore Headless Services:
-
Download the Sitecore Headless Services package compatible with your Sitecore version. See the Sitecore modules compatibility table for Sitecore XP.
-
Log in to your Sitecore instance.
-
Open the Desktop. On the Sitecore menu (lower left), click Development Tools, then Installation Wizard.
-
Follow the wizard to install the Sitecore Headless Services zip package.
-
For Sitecore 9.0.x only (not 9.1), in your
/Web.config
file, alter the binding redirect forNewtonsoft.Json
:RequestResponse<dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" /> <!-- change the oldVersion from 9.0.0.0 to 11.0.0.0. Leave newVersion alone (do not make it 11.0). --> <bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="9.0.0.0" /> </dependentAssembly>
-
To verify your server components installation worked, visit
http://your-sitecore-instance/sitecore/api/layout/render/jss?item=/&sc_apikey=TEST
. You receive the messageHTTP Error 400.0 - API key is not valid
if it is working correctly.TipBrowsers might obscure the message behind a custom error page for HTTP 400. You might need tools like Postman or browser-specific developer tools to see this message.
Configure the CD instance in a scaled Sitecore environment
If you are installing Sitecore Headless Services to a scaled Sitecore environment (production environments with separate CM and CD servers), you must configure the CD instance.
To configure the CD instance to install the Headless Services module:
-
Extract the server components Sitecore package.
-
Extract the inner
package.zip
file. Ignore any unzip warnings aboutsc_*.txt
files. -
Deploy the following
package/files
files in thefiles
folder to your CD server's webroot:App_Config
,bin
,sitecore
,Views
,sitecore modules\items\web
andsitecore modules\items\core
. -
On a CD server, in
/Web.config
, in the<handlers>
section, add the following key:RequestResponse<add verb="*" path="sitecorejss_media.ashx" type="Sitecore.JavaScriptServices.Media.MediaRequestHandler, Sitecore.JavaScriptServices.Media" name="Sitecore.JavaScriptServices.Media.MediaRequestHandler" />