39
Sitecore Multi-Site Implementations Best Practices Prepared by: Eduardo Moraes and Roberto Barbedo

Sitecore Multi-Sites

Embed Size (px)

DESCRIPTION

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.

Citation preview

Page 1: Sitecore Multi-Sites

Sitecore Multi-Site ImplementationsBest Practices

Prepared by: Eduardo Moraes and Roberto Barbedo

Page 2: Sitecore Multi-Sites

Sitecore Multi-Sites Best Practices

• What is recommended by Sitecore

• Challenges, solutions and recommendations from the Community

The Nonlinear way

Q&A

Page 3: Sitecore Multi-Sites

Sitecore and Multi-sites

Page 4: Sitecore Multi-Sites

So you want multiplesites running in your Sitecore instance, eh?

Page 5: Sitecore Multi-Sites

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

Page 6: Sitecore Multi-Sites

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" />

Page 7: Sitecore Multi-Sites

How?

• Sitecore determines the site context based on the incoming URL and the following attributes:

1. hostName2. virtualFolder (and physicalFolder)

In other words, the hostName and virtualFolder attributes define a unique site in Sitecore.

Page 8: Sitecore Multi-Sites

Example

• Under <sites> node <site name="mynewsite" hostName="www.mynewsite.com" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content/mynewsite" startItem="/homepage" language="en" database="web" domain="extranet" allowDebug="true" cacheHtml="true" htmlCacheSize="10MB" enablePreview="true" enableDebugger="true" />

Page 9: Sitecore Multi-Sites

No problemo, right?

Well… not exactly.

Page 10: Sitecore Multi-Sites

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

Page 11: Sitecore Multi-Sites

Some solutions...

Page 12: Sitecore Multi-Sites

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

Page 13: Sitecore Multi-Sites

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)

Page 14: Sitecore Multi-Sites

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

Page 15: Sitecore Multi-Sites

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/

Page 16: Sitecore Multi-Sites

Best Practices:Recommend by the Community

Page 17: Sitecore Multi-Sites

#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.

Page 18: Sitecore Multi-Sites

#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

Page 19: Sitecore Multi-Sites

#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

Page 20: Sitecore Multi-Sites

#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

Page 21: Sitecore Multi-Sites

#5. Organize templates in site specific template folders

#6. Organize layouts and sub-layouts in site specific folders

Page 22: Sitecore Multi-Sites

#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

Page 23: Sitecore Multi-Sites

#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

Page 24: Sitecore Multi-Sites

#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

Page 25: Sitecore Multi-Sites

#10. Make sure to configure the indexes for each site

• Lucene or SOLR indexes should be configured for each site

Page 26: Sitecore Multi-Sites

Demo - “the Nonlinear way”

Page 27: Sitecore Multi-Sites

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

Page 28: Sitecore Multi-Sites

Use patch to add site configurations

Page 29: Sitecore Multi-Sites

Naming conventions for config files

Page 30: Sitecore Multi-Sites

Content - Shared x Exclusive

Page 31: Sitecore Multi-Sites

Components

Page 32: Sitecore Multi-Sites

Rules

The rules engine in sitecore can be very useful to uncouple multi-site implementations

• Insert Options• Placeholder Settings• Even RTE CSS definition

Page 33: Sitecore Multi-Sites

Insert Options

Same template, different insert options

Page 34: Sitecore Multi-Sites

Resources

Page 35: Sitecore Multi-Sites

Sitecore CommunityUpdates 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 Ursinohttp://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

Page 37: Sitecore Multi-Sites

• Keystone for Sitecore: http://keystoneforsitecore.com/

Page 38: Sitecore Multi-Sites

Questions?

Page 39: Sitecore Multi-Sites

Thank You!Eduardo Moraes - Senior Consultant Sitecore MVP

@eduardomoraesblog: http://pageditor.wordpress.com/

Roberto Barbedo - Certified Sitecore Developer @RobertoBRBRblog: http://www.sitecoreinsight.com/