How IIS Bindings Works

Source: https://sharepoint.fpweb.net/sharepoint-blog/understanding-iis-bindings-rules-and-practices/

Let’s make sure our servers are directing web traffic properly with some basic IIS Bindings rules and practices.

While IIS is a powerful tool for hosting sites on Microsoft Servers, we will only be going over the “easy” stuff in this article. However, it’s safe to say that before you perform an operation that requires you to edit the web.config file for a site, you may want to check IIS first since it will typically provide a GUI to do the same thing. Without further ado, let’s dive right in.

IIS or ‘Internet Information Services’ is a set of services for servers using Microsoft’s operating system.

Many versions of IIS exist, but if you are working on a server today, you’ll typically be using 6.0, 7.0, 7.5, 8.0, or 8.5. You can run more than one version on a server at a time as well, (such as both 6.0 and 7.0). The differences between 6.0 and the other versions are quite vast, (how they handle code and features), while 7.0, 7.5, 8.0, and 8.5 are similar, (although the later versions offer a few more features). The main purpose for this service is to house, administrate, configure and operate on your sites.

What is an IIS Binding?

A IIS binding is simply a mechanism that “binds” to your site and tells the server how this site can be reached. An IIS Binding is simply a binding that lives in IIS. When we talk about IIS Bindings, we are talking about this part of IIS:

Internet Information Services

As you can see, it’s aptly named.

Why are IIS Bindings Important?

Because we need them to direct the traffic sent to the server to the appropriate site. In other words, DNS will direct traffic to your server, and then bindings take over to get that traffic to the appropriate site by using the sites’ binding.

The primary rule for bindings is that when you have multiple bindings, each must differ in some way. We have three binding options in which to do this with. They are Port, IP Address, and Host Header. When working with multiple sites, no site can have the same Port, IP Address, and Host Header as another; they must differ on at least one of these criteria.

Internet Ports

How do IIS Bindings Work?

So when a request hits the server, the first thing it looks for is Port. The two most common Ports are port 80 (HTTP) and 443 (HTTPS). That being said, it’s not uncommon to have multiple sites using either Port.

The next item that a request considers is IP Address. This can really go either way. If you have plenty of static IP Addresses to use, then it’s best practice to have a unique IP Address for each site. However, you can use the same IP Address for multiple sites if you are paying per IP.

So, what happens when you share the same Port and IP Address? You must differentiate by Host Header, (aka Host name). This name must match the request exactly. So, if you are trying to reach a site by www.test.com, then you must have www.test.com as the Host Header. Want to access by Test.com? Then you must have Test.com in the Host Header. Sites may have multiple Host Headers to compensate for CNAMES/Alias’ or sites that are accessed by different names.

*On a side note, when you’re ordering an SSL be careful of the name you choose. It must be accessed by exactly that name (unless it’s a wildcard certificate). You can use IIS Redirects to “force” requests into appropriate bindings, but I will cover that in detail in another post.

Proper Planning Makes IIS Bindings Successful

This is the “very” basic essence of bindings. While seemingly simple, this can become a major pain point when dealing with many sites if proper planning and/or documentation is not utilized. If you cannot get a site to start without it automatically stopping another, then you have a binding conflict that you must address. Proper planning will avoid this issue altogether, so keep these rules in mind when planning your environment.

Dynamic Programming Practice Problems

remember the past
source: https://blog.usejournal.com/top-50-dynamic-programming-practice-problems-4208fed71aa3

Dynamic Programming is a method for solving a complex problem by breaking it down into a collection of simpler subproblems, solving each of those subproblems just once, and storing their solutions using a memory-based data structure (array, map,etc). Each of the subproblem solutions is indexed in some way, typically based on the values of its input parameters, so as to facilitate its lookup. So the next time the same subproblem occurs, instead of recomputing its solution, one simply looks up the previously computed solution, thereby saving computation time. This technique of storing solutions to subproblems instead of recomputing them is called memoization.

Here’s brilliant explanation on concept of Dynamic Programming on Quora — Jonathan Paulson’s answer to How should I explain dynamic programming to a 4-year-old?

Please find below top 50 common data structure problems that can be solved using Dynamic programming –

  1. Longest Common Subsequence | Introduction & LCS Length
  2. Longest Common Subsequence | Finding all LCS — Techie Delight
  3. Longest Common Substring problem — Techie Delight
  4. Longest Palindromic Subsequence using Dynamic Programming
  5. Longest Repeated Subsequence Problem — Techie Delight
  6. Implement Diff Utility — Techie Delight
  7. Shortest Common Supersequence | Introduction & SCS Length
  8. Shortest Common Supersequence | Finding all SCS — Techie Delight
  9. Longest Increasing Subsequence using Dynamic Programming — Techie Delight
  10. Longest Bitonic Subsequence — Techie Delight
  11. Increasing Subsequence with Maximum Sum — Techie Delight
  12. The Levenshtein distance (Edit distance) problem — Techie Delight
  13. Find size of largest square sub-matrix of 1’s present in given binary matrix — Techie Delight
  14. Matrix Chain Multiplication using Dynamic Programming
  15. Find the minimum cost to reach last cell of the matrix from its first cell — Techie Delight
  16. Find longest sequence formed by adjacent numbers in the matrix — Techie Delight
  17. Count number of paths in a matrix with given cost to reach destination cell
  18. 0–1 Knapsack problem — Techie Delight
  19. Maximize the Value of an Expression — Techie Delight
  20. Partition problem | Dynamic Programming Solution — Techie Delight
  21. Subset Sum Problem — Techie Delight
  22. Minimum Sum Partition Problem — Techie Delight
  23. Find all N-digit binary strings without any consecutive 1’s — Techie Delight
  24. Rod Cutting Problem — Techie Delight
  25. Maximum Product Rod Cutting — Techie Delight
  26. Coin change-making problem (unlimited supply of coins) — Techie Delight
  27. Coin Change Problem (Total number of ways to get the denomination of coins) — Techie Delight
  28. Longest Alternating Subsequence Problem — Techie Delight
  29. Count number of times a pattern appears in given string as a subsequence
  30. Collect maximum points in a matrix by satisfying given constraints — Techie Delight
  31. Count total possible combinations of N-digit numbers in a mobile keypad — Techie Delight
  32. Find Optimal Cost to Construct Binary Search Tree — Techie Delight
  33. Word Break Problem | Dynamic Programming — Techie Delight
  34. Word Break Problem | Using Trie Data Structure — Techie Delight
  35. Total possible solutions to linear equation of k variables — Techie Delight
  36. Wildcard Pattern Matching — Techie Delight
  37. Find Probability that a Person is Alive after Taking N steps on an Island
  38. Calculate sum of all elements in a sub-matrix in constant time — Techie Delight
  39. Find Maximum Sum Submatrix in a given matrix — Techie Delight
  40. Find Maximum Sum Submatrix present in a given matrix — Techie Delight
  41. Find maximum sum of subsequence with no adjacent elements — Techie Delight
  42. Maximum Subarray Problem (Kadane’s algorithm) — Techie Delight
  43. Single-Source Shortest Paths — Bellman Ford Algorithm — Techie Delight
  44. All-Pairs Shortest Paths — Floyd Warshall Algorithm — Techie Delight
  45. Pots of Gold Game using Dynamic Programming — Techie Delight
  46. Find minimum cuts needed for palindromic partition of a string
  47. Maximum Length Snake Sequence — Techie Delight
  48. 3-Partition Problem — Techie Delight
  49. Calculate size of the largest plus of 1’s in binary matrix — Techie Delight
  50. Check if given string is interleaving of two other given strings

How to transfer a GoDaddy SSL certificate to Windows IIS 8

https://www.itworld.com/article/2931768/how-to-transfer-a-godaddy-ssl-certificate-to-windows-iis-8.html

Moving an SSL certificate to a new server isn’t always straight forward. Moving one from Godaddy to a new Windows Server proved downright frustrating since their directions result in a disappearing certificate.

The problem is that the generated certificate was created using a certificate signing request (CSR) from a different machine, and the private key is not included in the SSL bundle (with good reason). When you try and import an SSL certificate into IIS using the steps outlined by Godaddy here, Windows Server will give the impression that everything worked just fine and no error will be given. You can even open and view the newly imported certificate in IIS Manager. But this is lies! Silently, Windows rejected the certificate because it did not contain a private key it could validate and you only find out about it when you try to apply the cert to a website and the certificate no longer exists.

To solve this issue we can make use of a handy tool Godaddy provides that lets you re-key a certificate. In this way, we can generate a new ‘Create Certificate Request’ on the new server and rey-key the SSL certificate based on the newly generated private key. It sounds hard, but here’s pictures:

Step 1)

Log into your GoDaddy account, expand the SSL Certificates section, and click the Manage button for the SSL Certificate you want to transfer.

Step 2)

Click on the ‘View Status’ link for the SSL Certificate to transfer

Step 3)

Click on the big ‘Manage’ button. You’ll now be on the Manage Certificate screen

Step 4)

Before we proceed further, we need to generate a new Certificate Signing Request on the Windows Server. Open IIS Manager and click on the server node you want to add the certificate to. Then select the ‘Server Certificates’ item toward the bottom. On the Server Certificates screen, click the ‘Create Certificate Request’ link. Fill out the certificate information and save the file to your desktop. Open the certificate request file in notepad and copy the contents.

Step 5)

Back at the GoDaddy certificate manager, expand the Re-Key Certificate area and paste in your certificate request. Verify the domain name you want to protect is displayed and hit save. GoDaddy will now go through a process of validating your account and re-keying your certificate. This should only take a couple of minutes.

Step 6)

Back at the Server Management Options screen, click the big ‘Download’ button to retrieve your newly keyed certificate. Choose the IIS option from the select box and copy the zip file to your Windows Server.

Step 7)

Unzip the certificate files to your Windows server, then click the ‘Complete Certificate Request’ link back in the IIS Manager Server Certificates area. Choose the certificate you just downloaded from GoDaddy and select the ‘Personal’ store for the certificate and click OK.

Finished

Now you should be able to choose the SSL certificate for your website in IIS as you’d expect without it vanishing on you.

Don’t forget to import the intermediate certificated from GoDaddy (those instructions do work) if you don’t have them already or else your new certificate may throw warnings on client browsers.