Surendra Sharma

Surendra Sharma

Search This Blog

Showing posts with label iis. Show all posts
Showing posts with label iis. Show all posts

Monday, August 13, 2018

SSL certificates role in Sitecore 9

When you installed Sitecore 9 and above, setup should finished with two websites. Normally names like "*.dev.local" and "*_xconnect.dev.local".

Lets take an example of Habitat site.
 

"habitat.dev.local" runs on port 80 and 443 while "habitat_xconnect.dev.local" runs on HTTPS using 443 port. For running on HTTPS, we have to bind it to certificates.

Some of the questions about certificates that come to our mind are

  • How to bind certificates to websites?
  • How to change certificates to websites?
  • Where to find certificates?
  • Where to specify their thumbprint values?

How to bind/change certificates to these websites
Select website -> Click on Bindings -> Select Site running on port 443 and click on Edit -> Click on View button to view SSL certificate.
or change certifcates from available SSL certificates dropdownlist list.



SSL Certificate in IIS
SSL Certificate in IIS

 

Where to find certificates
For this click on Start -> search for "Manage Computer Certificates" -> This should open "certlm" -> Expand Personal -> Select "Certificates" -> Select your website and double click website -> This should open "Certificate" window -> Select "Details" tab -> Check "Thumbprint" property as shown below


Available certificates in machine
Available certificates in machine


You will get three certificates for each Sitecore 9 instance.

  • habitat.dev.local
  • habitat.dev.local.xConnect.Client
  • habitat_xconnect.dev.local

We can guess what are "habitat.dev.local" and "habitat_xconnect.dev.local", but what is "habitat.dev.local.xConnect.Client"?

Sitecore 9 is like client-server model where client is Sitecore webiste "habitat.dev.local" whereas xConnect instance "habitat_xconnect.dev.local" act as a server.

So if client want to communicate with server over secure HTTPS channel, they must agree with one thumbprint key. This thumbprint key is specified in new certificate "habitat.dev.local.xConnect.Client".

Where to specify thumbprint values for Sitecore and xConnect instances?
You have to specify
thumbprint value of "habitat.dev.local.xConnect.Client" at below locations.

For Sitecore website instance

 
Open "ConnectionStrings.config" from "C:\inetpub\wwwroot\habitat.dev.local\App_Config" and check below keys for client certificate thumbprint value

  • xconnect.collection.certificate
  • xdb.referencedata.client.certificate
  • xdb.marketingautomation.reporting.client.certificate
  • xdb.marketingautomation.operations.client.certificate


Thumbprint value in connectionstring.config
Thumbprint value in connectionstring.config


For xConnect instance
Open "AppSettings.config" from "C:\inetpub\wwwroot\habitat_xconnect.dev.local\App_Config" and check "validateCertificateThumbprint" key value.




Thumbprint value in AppSettings.config
Thumbprint value in AppSettings.config


Certificate is complex subject but I hope these details helps you to understand certificates role in Sitecore 9. Stay tuned for more Sitecore related articles.

Till that happy Sitecoring :)


Wednesday, April 5, 2017

How to recycle application pool automatically in IIS


What will you do if you get a call on holiday or weekend that your website hosted server is consuming 95% CPU utilization due to IIS worker process and within a few minutes, your server is going to crash and your website will not be accessible?


You have to access the server and recycle your app pool, right?

Can we provide some automated solution for this?

Yes, fortunately IIS can take care of this situation.

Let's say if CPU utilization reached to 92% and it remains at 92% or more for next 3 minute then we want IIS should recycle application pool automatically.

Follow below steps to achieve this.

  • Open IIS. 
  • Right click on your website application pool and select “Advance Setting…
  • Locate CPU section 
  • Put Limit (percent) as 92% 
  • Set Limit Action at KillW3wp 
  • Set Limit Interval (minutes) at 3 
  • Click Ok

That's it.

Here is a screenshot for quick understanding

App Pool Recycle automatically
App Pool Recycle automatically

Now no manual intervention is required. You can enjoy your weekend. But remember this is not a a solution, this is just a work around for the problem. You should find the root cause of the problem.