Sitecore 6.6 publishing to multiple targets - sitecore

Currently working on a sitecore solution which is running version 6.6 and we're experiencing some odd behavior. The site is setup to have multiple targets which are all pointing to individual databases for a webserver for instance web1 - web3 etc... I can confirm that all connection strings are correct and that the web servers are able to communicate to/from the sitecore cms server.
With a lot of reading I found out about the EnableEventQueues (http://www.sitecore.net/learn/blogs/technical-blogs/getting-to-know-sitecore/posts/2010/07/introducing-the-sitecore-event-queue.aspx) which in theory should have resolve this problem, however having enabled this on all web nodes and the cms server it's still experiencing issues.
Our other theory was to recycle an app pool to check if sitecore had cached old content and was waiting on a period to update its cache? However this seemed to fail but pointing the connection string to a working on then worked, so it was like sitecore had only published the changed to a select few nodes.
We're currently at a stand still as to what could be causing this, unless there's any other configs which require enabling?
The ScalabilitySettings.config looks like:
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<setting name="EnableEventQueues">
<patch:attribute name="value">true</patch:attribute>
</setting>
<setting name="InstanceName">
<patch:attribute name="value"></patch:attribute>
</setting>
<setting name="Publishing.PublishingInstance">
<patch:attribute name="value"></patch:attribute>
</setting>
<setting name="Counters.InstanceName">
<patch:attribute name="value"></patch:attribute>
</setting>
<setting name="Caching.SecurityCacheExpiration">
<patch:attribute name="value">00:20:00</patch:attribute>
</setting>
<setting name="Media.DisableFileMedia">
<patch:attribute name="value">false</patch:attribute>
</setting>
<setting name="Media.FileFolder">
<patch:attribute name="value">/App_Data/Replicated/MediaFiles</patch:attribute>
</setting>
</settings>
</sitecore>
</configuration>
Many thanks,
Shaun

Can you show your scalability settings? Specifically, the Instance Name and Publishing Instance Name for your CDs and CMs?
Usually, it is the event queues, as you surmised, but perhaps you have something off in those particular files for the instance names. They should all have the same publishing instance name value and unique values for the instance name.
Update:
Now that I see your scalability settings, I can see the issue. You will need to give your content management instance where publishing is occurring a name. Perhaps something as simple as "CM".
On the content management server, the scalability settings will need to be setup with the same value in the Publishing.PublishInstance and InstanceName settings (e.g. "CM").
On your content delivery servers, the scalability settings will need to be setup with the publishing instance value (e.g. Publishing.PublishInstance = "CM")
You can provide unique InstanceName values on each CD if you like, or leave it blank and Sitecore will generate a unique value for each CD.
Why is this needed?
The event queue informs all sitecore instances connected to it about the events coming from the publishing instance. Each instance needs to know who their associated publisher is so that they know which events to process.

Related

Sitecore Custom Membership Provider

We have a need to use an existing external database for our membership needs. This database will contain all the basic information needed to authenticate and authorize users. I'm looking to see if you have documentation that can guide me through this process. I've seen posts online for custom membership providers implementation. But I haven't seen examples on how to integrate the custom membership provider with Sitecore API so Sitecore.Context.User will return the information of the logged in user.
Also, is there a way to access the custom profile information via Sitecore API?
Thanks
As promised in my comment here is our setup for enabling the Sitecore setup to stay the same while adding an extra membership provider to use in your website specifically.
First this can be found inside of our web.config transform file under the <system.web>:
<membership hashAlgorithmType="SHA256" xdt:Transform="SetAttributes(hashAlgorithmType)">
<providers>
<add name="sitecore" type="Sitecore.Security.SitecoreMembershipProvider, Sitecore.Kernel" realProviderName="switcher" providerWildcard="%" raiseEvents="true" xdt:Locator="Match(name)" xdt:Transform="Replace" />
<add name="myprovider" type="MyProject.SecurityProviders.MembershipProvider, MyProject.SecurityProviders" applicationName="sitecore" xdt:Transform="Insert"/>
</providers>
</membership>
<roleManager>
<providers>
<add name="sitecore" type="Sitecore.Security.SitecoreRoleProvider, Sitecore.Kernel" realProviderName="switcher" raiseEvents="true" xdt:Locator="Match(name)" xdt:Transform="Replace" />
<add name="myprovider" type="MyProject.SecurityProviders.RoleProvider, MyProject.SecurityProviders" applicationName="sitecore" xdt:Transform="Insert"/>
</providers>
</roleManager>
Next this is found in a separate config include file directly under <sitecore>:
<switchingProviders>
<membership>
<provider providerName="myprovider" storeFullNames="false" wildcard="%" domains="websitedomain" patch:before="*"/>
</membership>
<roleManager>
<provider providerName="myprovider" storeFullNames="false" wildcard="%" domains="websitedomain" patch:before="*"/>
</roleManager>
</switchingProviders>
These 2 changes in configuration will enable you to create a custom membership and role provider (in case you need one). As you can see the tricky part is not making the switching membership provider of sitecore the default provider (as stated in the documentation 2.6.2) but setting the realProviderName of the sitecore provider to switcher.
From hereon it is straightforward implementation of ASP.NET Membership.
You have seen this document already?
A Developer's Guide to Integrating Authentication Systems with Sitecore
It talks you through the whole process of creating an ASP.net membership provider. The whole point of the provider is that it abstracts the API from the implementation, so you can definitely achieve what you need.
Essentially, you need to override all the relevant methods from the base ASP.Net provider, using them to "wrap" around equivalent calls to your external database.

website not updated after sitecore publish

I have setup my Sitecore installation to two different IIS Sites. One has all of the Sitecore Admin files and the other one has a clean web only files sharing the same Web.config, and my Data folder is outside of both folders.
-Sitecore.Data
--Licenses and Logs
-Sitecore.Admin
--Sitecore (folder with files)
-Sitecore.Web
--html,css, and js files
The problem I am running into is that after I do a publish from Sitecore.Admin folder, the Sitecore.Web doesn't update with the changes unless I recycled the app pool for Sitecore.Web. I tried to add a task for recycle the app pool programmatically, but had no success.
<processor type="MySite.Sitecore.Publishing.IISReset, MySite.Sitecore" />
Any suggestion on how to propagate the changes from one IIS node to the other one. I think the problem is that the HtmlCacheClearer is run for the Sitecore.Admin Node, but not for the other one.
You need to enable the EventQueues.
The EventQueues propagates the different events, like publishing, item saved etc. to the frontend servers.
Basically you need to rename a config file.
/App_Config/Include/ScalabilitySettings.config.example to ScalabilitySettings.config
That config file enables the event queue, and some other configurations.
I recommend reading the Sitecore Scaling guide.
http://sdn.sitecore.net/Reference/Sitecore%206/Scaling%20Guide.aspx
Just like dunston said, make sure that ScalabilitySettings.config file is configured right
By enabling EventQueue
And making sure that instance name on Content Delivery server is Unique per server, like 'MachineName-CD1, MachineName-CD2'.
And make sure that HtmlCacheClearer event is added for your website name on PublishEnd:Remote event.
Besides enabling event queue like dunston said, also make sure that your website name is added to the publish:end and publish:end:remote HtmlCacheClear events, if you are using a different site then the default "website" otherwise you Html cache doesn't get cleared at all after a publish.
<event name="publish:end">
<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
<sites hint="list">
<site>website</site>
</sites>
</handler>
</event>
<event name="publish:end:remote">
<handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
<sites hint="list">
<site>website</site>
</sites>
</handler>
</event>
By publishing though, it sounds like you are possibly talking about deploying new code and you want it to trigger an application pool restart across multiple web servers, regardless? If that is the case, you could add something like this to the logic of that Publishing.IISReset that you built. It could connect to your various public-facing only instances and execute something like:
appcmd recycle apppool sitecore6
This will obviously restart Sitecore on those boxes and cause all the caches to reset completely, free of doubt.

Sitecore: Serve up files within a folder within the content tree

I was wondering the best way to simply be able to put files on the server and have them served up.
www.mycompany.com/Folder/Bunchoffiles.pdf
www.mycompany.com/Folder/ATransformation.xsl
www.mycompany.com/Folder/crazyLogo.png
is there a simple way of just adding files to a folder in the content tree? Can I add these files to the media library and then put them in the content tree somehow?
Sitecore CMS 6.5
If the .ashx extensions bother you, you can disable them in favor of the normal file extension by doing the following:
Create a file in /App_Config/Include called MediaSettings.config or similar with the following:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<setting name="Media.RequestExtension">
<patch:attribute name="value"></patch:attribute>
</setting>
</settings>
</sitecore>
</configuration>
If the /~/media prefix bothers you, you can also modify that. Again, modify the file from above like so. This will allow your new prefix path (see: -/media) as well as supporting the original ~/media:
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<setting name="Media.RequestExtension">
<patch:attribute name="value"></patch:attribute>
</setting>
<setting name="Media.MediaLinkPrefix">
<patch:attribute name="value">-/media</patch:attribute>
</setting>
</settings>
<customHandlers>
<handler trigger="-/media/" handler="sitecore_media.ashx"/>
</customHandlers>
</sitecore>
</configuration>
John West has already written a great blog post on the subject that covers these and other things. I recommend you check that out. Alternatively, if you simply must have a file at /Folder/MyFile.ext you can create those folders and upload those files to the locations you need on the web server in the web root.

Getting Sitecore 404 for physical files

The media library URL (/sitecore/shell/Applications/Media/MediaShop/default.aspx) is being picked up by the SiteCore handler and redirected to the page-not-found page Sitecore uses (/sitecore/service/notfound.aspx). The file is a physical file and is actually there. I've seen things like this happen with items in the Sitecore content tree, but not with physical files. Any ideas where to look would be appreciated. Thanks.
Update: So, the issue as described above is fixed, but it's clear that there are other problems, seemingly also media related. This file: /sitecore/shell/applications/media/mediafolder/mediafolder.js is showing the same symptoms I've described above. They file is there on the server, but Sitecore is redirecting to it's 404 page.
Ok...here it is: Found this line in the web.config:
<handler trigger="/media/" handler="sitecore_media.ashx"/>
Which should be this:
<handler trigger="~/media/" handler="sitecore_media.ashx" />
After I made that change, everything worked great.
It looks like the physicalFolder attribute of your sites configuration is not set properly.
<site
name="helloworld"
hostName=www.helloworld.com
virtualFolder="/virtual"
physicalFolder="/hello"
rootPath="/sitecore/content"
startItem="/Hello Home"
language="en"
database="web"
domain="extranet" />
Double check if this parameter for the site is set properly. According to the Sitecore documentation, the files stored in the physical folder always take precedence over the Sitecore Items. Here are some details about the physicalFolder part of the sites config:
site Attribute Properties: physicalFolder
If it's not a problem with the sites configuration you may try to put a txt file or an image in the same directory and check whether Sitecore serves them properly.
I apologize if this is patronizing, but I'll post it anyway in case it helps.
Have you registered the path to be ignored in the "IgnoreUrlPrefixes" setting? I don't see that anyone has mentioned that, but perhaps that's because it's obvious.
<setting name="IgnoreUrlPrefixes" value="/sitecore/shell/Applications/Media/MediaShop/default.aspx" />

Sitecore IndexFolder (override default setting) not working

I've recently had some trouble moving the location of the indexes folder (for the in built Sitecore Lucene indexes).
I have updated the setting "IndexFolder" (originally in web.config but moved out into include). The config output in http://{mydomain}/sitecore/admin/showconfig.aspx is correct, the setting has the correct path (now in the Data folder instead of Website folder).
However, when I jump into the control panel and rebuild the index, it is still created in the default location ("/indexes", relative to the web application).
Has anyone had a similar problem in Sitecore not using the correct path?
Make sure the new folder is writable by ASPNET-user or NETWORK SERVICES.
If that's not working, list a Sitecore support case.
OK, when adding settings to an include file make sure you get the xml path correct.
I had:
<sitecore>
<setting name="IndexFolder" value="C:\...\Indexes" />
</sitecore>
Should have had:
<sitecore>
<settings>
<setting name="IndexFolder" value="C:\...\Indexes" />
</settings>
</sitecore>
All is well in Lucene world. Thanks for your help everyone, but it turns out I'm a victim of my own stupidity.