The Sitecore Customer Experience Platform comes with powerful multi-site capabilities, but following a few key best practices can ensure your deployment is high-performing, efficient, scalable and easy to maintain. We will cover tips and tricks to a robust multi-site architecture in Sitecore.
2. Sitecore Multi-Sites Best Practices
• What is recommended by Sitecore
• Challenges, solutions and recommendations from the
Community
The Nonlinear way
Q&A
4. So you want multiple
sites running in your
Sitecore instance, eh?
5. Out-of-the-box
• Multi-site support
• A default Sitecore installation defines a single published web
site. However, Sitecore ships with a number of logical web
sites defined in web.config.
• These are: shell, login, testing, admin, modules_shell,
modules_website, website, scheduler, system, publisher
• New sites can be added to web.config under <sites> node
6. How to add a new site
• Under <sites> node
<site
name="website"
virtualFolder="/"
physicalFolder="/"
rootPath="/sitecore/content"
startItem="/home"
language="en"
database="web"
domain="extranet"
allowDebug="true"
cacheHtml="true"
htmlCacheSize="10MB"
enablePreview="true"
enableDebugger="true" />
7. How?
• Sitecore determines the site context based on the incoming
URL and the following attributes:
1. hostName
2. virtualFolder (and physicalFolder)
In other words, the hostName and virtualFolder attributes
define a unique site in Sitecore.
10. So… what’s the “problem” with that?
• Changes to web.config will cause an application restart
- Requires a developer to add the configuration settings
- Same application pool for all sites
- Application pool restart
- Session state will be lost
- IIS log files are the same for all sites
- Unique robots.txt and sitemap.xml for all sites
- Other “hidden” problems… internal links, search results, modules, security
12. Available on marketplace.sitecore.net
• Makes it possible to add and configure multiple sites from inside the Sitecore
client without editing the web.config file
- For a long time was limited to a single server; version 3.1.2 should have it solved.
- Still same application pool for all sites
- Of course… still requires updates to hosts file and IIS binding
13. Isolating a site
• It is possible to add multiple IIS sites pointing to the same Sitecore instance
(physical website folder)
- Gives you separate application pools for each site
- Gives you an IIS log file for each site
• This configuration is NOT recommended by Sitecore
- All IIS sites are sharing the same data folder (possible issues with log files)
- All IIS sites are sharing the same database (inconsistent memory cache)
- Unknown side effects (not fully supported/tested by Sitecore)
14. Site isolation Sitecore’s recommendation
Sitecore recommends that instead of having each IIS site pointing to the same
installation folder, you duplicate the installation folder for each IIS site.
It ensures that Sitecore log files are updated correctly, and similar issues are
avoided.
“This setup, however, requires that you have a runtime license for each site.”
http://sdn.sitecore.net/Articles/Administration/Configuring%20Multiple%20Sites/Multiple%20IIS%20Sites.aspx
15. Robots.txt and Sitemap.xml
• Independent sitemap xml files for search engines can be generated with the
version 2.0 of the Sitemap XML module available at:
- https://marketplace.sitecore.net/Modules/Sitemap_XML.aspx
• Independent robots.txt can also be served for each site using the approach
suggested in the sitecoreclimber blog:
- http://sitecoreclimber.wordpress.com/2014/07/27/sitecore-multisite-robots-txt/
17. #1. Configuration: Use patch files for site
definitions
• Sitecore provides an example SiteDefinition config file
SiteDefinition.config.example
An example of how we do it at Nonlinear will follow during our demo.
18. #2. Separate site configuration items and
global configuration items
• Each site should have its own configuration setting items
• Configuration settings that are common for all sites should be
shared in a global settings folder
19. #3. Content: Separate page components,
site components and global components
• Components that are common for all sites should stay in a global
shared folder
• Components that are common for various pages inside a site
should stay in a site folder
• Page specific components should reside in a page (item) level
components folder
20. #4. Keep all site specific content under a
site level home node
• It facilitates the assignment of security settings to ensure only users
of that site will have access to it
21. #5. Organize templates in site specific
template folders
#6. Organize layouts and sub-layouts in
site specific folders
22. #7. Organize your Media Library items in
site specific media folders
• Media items that are shared with all sites can be maintained in a
global media folder
23. #8. Make sure internal links are considering
different site domains
• Rendering.SiteResolving in web.config must be set to true
• hostName must be properly set
24. #9. When sharing workflows between sites,
combine it with role based content access
Example:
• User A wants to edit and submit content for site A only
• He would need to have access to the Edit state of the workflow
AND be part of the a role created to give him access to edit site A
and its descendents
25. #10. Make sure to configure the indexes for
each site
• Lucene or SOLR indexes should be configured for each site
27. The Nonlinear way - Keystone for Sitecore
• Keystone is a development accelerator for Sitecore, Keystone is the
result of 100s of site implementations.
• It is ready for multi-sites
32. Rules
The rules engine in sitecore can be very useful to uncouple multi-site
implementations
• Insert Options
• Placeholder Settings
• Even RTE CSS definition
35. Sitecore Community
Updates on the multiple sites module to support multiple CD done on version 3.1.2 by niket.ashesh:
http://blog.xcentium.com/2013/09/sitecore-multiple-sites-manager/
Another way of organizing page level components, as suggested by Toby Gutierrez:
http://www.awareweb.com/awareblog/8-15-14-SitecoreArchScalability
Enable Multi-level Site Property Inheritance by Pascal Mathys:
http://sitecore.unic.com/2014/08/08/enable-multi-level-site-property-inheritance
Sitecore Managed Sites as Virtual Folders by Mark Ursino
http://firebreaksice.com/sitecore-managed-sites-as-virtual-folders/
Robots.txt multiple sites approach suggested by Vlad Iobagiu:
http://sitecoreclimber.wordpress.com/2014/07/27/sitecore-multisite-robots-txt/
Multisites resource index compiled by John West:
http://www.sitecore.net/Learn/Blogs/Technical-Blogs/John-West-Sitecore-
Blog/Posts/2013/10/Sitecore-Multisite-Part-0-Resource-Index.aspx