website not updated after sitecore publish - sitecore

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.

Related

Sitecore 6.6 publishing to multiple targets

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.

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.

Intermittently needing to re-add a version of a page

Intermittently we are getting a message The current item does not have a version in "English : English when clicking on an item (page) in the content tree for Sitecore.
We click the link Add a new version but from time to time, we get the same message that there isn't a version.
Anyone experience this before / have an idea of the cause?
This message is shown from this class: Sitecore.Pipelines.GetContentEditorWarnings.HasNoVersions. Can you check if you have custom code for removing versions?
Please check if you have custom code here:
<event name="item:versionRemoved">
<handler type="Sitecore.Globalization.ItemEventHandler, Sitecore.Kernel" method="OnVersionRemoved"/>
<handler type="Sitecore.Links.ItemEventHandler, Sitecore.Kernel" method="OnVersionRemoved"/>
<handler type="Sitecore.Rules.ItemEventHandler, Sitecore.Kernel" method="OnVersionRemoved"/>
</event>
.
The issue was because we were only using a Master database and publishing to the Master DB and so overwriting and SiteCore understandably getting confused!

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

Pipeline in Sitecore active directory module?

I've already installed the Sitecore active directory module. When a user from active directory has been created, deleted or renamed I want to execute some custom code. Is there a pipeline or function to hook in? Any ideas?
As Trayek said, you can add your custom event handlers in the events:
//Creation
<event name="user:created">
</event>
//Deletion
<event name="user:deleted">
</event>
//Updation
<event name="user:updated"/>
</event>
First of all, override the Sitecore's code, in your custom command and debug, maybe you will be able to fetch the selected roles also, where you can see if the user is an active directory is selected, then you do your custom action, else let it execute as it is.
Hope it helps!
Regards,
Varun Shringarpure
You might be able to use the standard <event name="user:created" />, <event name="user:deleted" /> and/or <event name="user:updated" /> events. You can find these in the web.config, under the <events> node.
I don't know if the module comes with it's own pipelines/events, otherwise it might be better to use them.
[edit]
Do keep in mind this will also run for the creation, deletion and editing of other users (extranet, Sitecore, other domains).