This version of the website uses the following software versions:
Software | Version |
---|---|
Sitecore | 9.2.0 |
Solr | 7.5.0 |
Sitecore Installation Framework | 2.1.0 |
Visual Studio / MSBuild | 2019 / 16.x |
This project assumes the following settings:
Setting | Value | Change in 1 see below |
---|---|---|
Website location | C:\inetpub\wwwroot\urlmapper2.dev.local\ | settings.ps1 , LocalSettings.props.user |
Website URL (Portal) | http://urlmapper2.dev.local/ | settings.ps1 , Project.Portal.Sites.config |
SQL Server | . | settings.ps1 |
SQL Server Admin | sa | settings.ps1 |
SQL Server Password | sa | settings.ps1 |
SOLR URL | https://localhost:62200/solr (Note https) | settings.ps1 |
Important!: Check the prerequisites before starting the installation.
- Do check the prerequisites of Sitecore Experience Platform in the release notes available on dev.sitecore.net
- Do check the Resources page for the tools needed
- Always run your Visual Studio or PowerShell Command Line with elevated privileges or As Administrator
The Sitecore install script will check some prerequisites, including running the SIF Prerequisites.json
configuration.
The local installation requires the Apache Solr search engine. Solr must be running in a docker container and be available at https://localhost:62200/solr with a valid self-signed certificate.
All of that is handled for you when you run the Initialize-DockerEnvironment
task in the Task Runner Explorer within Visual Studio.
After running the task, verify that Solr is running. Be aware, at this point no Solr cores have been created. The will be created by SIF during the installation.
- Clone or Download the repository to your local file system.
- Download the correct version of Sitecore from dev.sitecore.net and place it in the
.\build\assets
folder.- This project will install by default on an Sitecore XP Single, i.e. a standalone version of Sitecore CMS including xConnect.
- The currently supported version is defined in the
.\settings.ps1
file - The installation requires the following files:
- A valid Sitecore license:
.\build\assets\license.xml
- Sitecore package:
.\build\assets\Sitecore X.X.X rev. XXXXXX (OnPrem)_single.scwdp.zip
- xConnect package:
.\build\assets\Sitecore X.X.X rev. XXXXXX (OnPrem)_xp0xconnect.scwdp.zip
- Identity Server package:
.\build\assets\Sitecore.IdentityServer X.X.X rev. XXXXXX (OnPrem)_identityserver.scwdp.zip
- A valid Sitecore license:
- Download the Sitecore Azure Toolkit from dev.sitecore.net and extract the contents of the
tools
folder into/build/sitecore-azure-toolkit
- Download the correct version of JSS and Sitecore PowerShell extensions and place them into the prepared /build/sitecore-modules folders. Check the README.mds within the subfolders for additional information about naming and the required versions. After that, run the
build\sitecore-modules\Prepare-WebDeployPackages.ps1
. This script will prepare the .scwdps so they can be installed on a local instance. - Are you using system settings other than the defaults specified at the top of this page?
- If yes, you need to update the files accordingly.
- Include or omit trailing slashes as per the default setting in each file!
- Open an elevated privileges PowerShell command prompt (started with Run as administrator)
- Run
.\install-xp0.ps1
-
On subsequent runs of the install, you may use the
-SkipPrerequisites
flag to skip prerequisite checks.After executing the
.\install-xp0.ps1
script you might run into this error:The service cannot accept control messages at this time
(the issue is that the IIS app pool is getting targeted, while it's still restarting). If this happens, go to.\build\sif-configs\XP0-SingleDeveloper.json
and delete the tasks before"SitecoreModules"
under"Includes"
. Now just run the script again. Don't forget to revert your changes on the .json file
-
install-xp0.ps1:146
- Create a file
.\be\LocalSettings.props.user
with the following content:
<Project>
<PropertyGroup>
<WebRootPath>c:\inetpub\wwwroot\urlmapper2.dev.local</WebRootPath>
</PropertyGroup>
</Project>
- Ensure that the path in
<WebRootPath>
corresponds to your local web root path
!!! Changes toLocalSettings.props.user
require a Visual Studio restart !!! - Build the solution in Visual Studio
If you encounter a build failure caused by locked assemblies in the webroot, run aniisreset
and try again.
- Sync Unicorn for the first time and check for sync warnings and errors.
TheSync all
link might not appear on an initial sync. Don't worry, you can use the link provided above directly
- Rebuild all search indexes through the Indexing manager in the Control Panel.
This is required for search-based features to work properly
- Run the
Install-Frontend
task from within Visual Studio's Task Runner Explorer
- The
Initialize-DockerEnvironment
task invokes a docker build, pulls all the latest images, runs docker-compose up and installs all self-signed certificates into the local store. - The
Start-DockerEnvironment
task pulls all the latest images and runs docker-compose up - The
Install-Frontend
task will build the JSS app and deploy the generated assets into the webroot and to the headless proxy directory (and replace the urls within the assets in order to work with a headless setup)
Please follow these steps if you want to connect to Azure Search instead of SolR:
- Create an Azure Cognitive Search service within the Azure Portal (make sure that you have at least the Standard plan selected)
- Copy one of the admin keys
- Add the following entry to the ConnectionStrings.config:
<add name="cloud.search" connectionString="serviceUrl=<url>;apiVersion=<apiVersion>;apiKey=<apiKey>" />
- Make sure to replace the tokens with the correct values. The
apiVersion
must be set to2017-11-11
. - In the
web.config
change the search provider from Solr to Azure:<add key="search:define" value="Azure" />
- Rebuild the indexes
- Ensure that the Search Service within the Azure Portal now contains entries
Resources:
A sample component has been scaffolded and can be found in the /fe
folder of the solution root. The API key used for the Layout service has been serialized for the integration website and is as follows: {F02CC0B5-BF7B-41B0-B570-C398A59FEC19}
.
All required content for the jss app (such as renderings, placeholder settings, etc.) have been serialized. Additionally, the jss-specific Sitecore patchings have been included into the integration project. Therefore, you should be able to have a running JSS solution as soon as you have triggered a build, run the Install-Frontend
task and have performed a Unicorn sync.
Additionally, a headless proxy based on the official documentation has been added and configured in the /fe/node-headless-ssr-proxy
folder.
In order to start the headless proxy, run the following commands in the /fe/node-headless-ssr-proxy
directory: npm install
and then npm start
.
The solution has the following two sites configured:
- http://urlmapper2.dev.local - this is the jss site
- http://urlmapper2.dev.local/integration - this is the "integration" site and is not running in JSS
The docker setup also provides a SEQ container used for logging, which can be accessed through the following url: http://localhost:62100/#/events
The development environments ships with some pre-defined redirects you can use for local testing. You can find them in the following .csv (which also acts as an example of the .csv
import format): be\etc\import\example-import-file.csv
Don't forget to update the AssemblyVersion
and AssemblyFileVersion
in AssemblyInfo.cs
to reflect the current release number and trigger a build so the updated assemblies are used for the installation package.
When you have made changes to the module and you want to disitribute those, there is a handy Sitecore PowerShell script you can use to generate the installation packages. The script can be found here: /sitecore/system/Modules/PowerShell/Script Library/UrlMapper2/Development/Generate-DistributionPackage
. Don't forget to set the proper version in the $version
variable.
Once you execute this script, it will prompt you to download two separate files: One for the CM and one for the CD instance.
Using the Sitecore Azure Toolkit, you can easily convert the generated packages to .scwdp
s which you can then use in your ARM/Azure deployments. Use the ConvertTo-SCModuleWebDeployPackage
cmdlet as follows:
ConvertTo-SCModuleWebDeployPackage "<path-to-installation-package>\UrlMapper2_CD-<version>.zip" "<output-path>"
ConvertTo-SCModuleWebDeployPackage "<path-to-installation-package>\UrlMapper2_CM-<version>.zip" "<output-path>"
Packages generated by Sitecore Azure Toolkit don't really follow the Microsoft standards in the
parameters.xml
file, since they define aApplication Path
parameter containing the application name instead of the standardIIS Web Application Name
parameters. In order to make the packages work with the default IIS Deployment and Azure App Service deployment tasks, theparameters.xml
needs to be adjusted accordingly and injected into the packages.
You can adjust the parameters.xml
using the Update-SCWebDeployPackage
cmdlet as follows:
Update-SCWebDeployPackage -Path "<path-to-scwdp>" -ParametersXmlPath "<path-to-parameters-xml>"
Please note that if you are planning to use the modules for local or on-prem installations, you will have to disable dacpac options, which can be accomplished as follows:
Update-SCWebDeployPackage -Path "<path-to-scwdp>" -DisableDacPacOptions '*' -ParametersXmlPath "<path-to-parameters-xml>"
More information about package conversion can be found in the official documentation.