Duplicated server will only return 404

Don Rea asked on June 10, 2022 22:29

I am trying to work on a bug that, at the moment, only manifests in production. Since I can't take down that environment I'm trying to create a copy that is as close as possible. The site is Kentico 11-based, running on Windows Server 2019 Datacenter on an Amazon EC2 t2 instance, backed by an RDS SQL Server Web Edition instance. To create the test environment I make a backup dump of the database and restore it to a different database on the instance, and create an AMI of the EC2 and use that launch a new EC2 instance.

This process has worked dozens of times in the past but this time, and I've done it four times so far today, the web site on the new instance will never return anything but a generic 404 status (that is, the minimal 404 page returned by IIS itself, not from Kentico). I cannot see anything that's different between the production instance and the copy except for details like the IP address and database connection string, and I cannot imagine any reason why there would be any difference. Does anyone have any ideas or suggestions at all?

EDIT: I have found that these requests to the copy are not being logged in its IIS request log. I don't know what that means, but it surprised me.

Correct Answer

Don Rea answered on June 11, 2022 20:23

After some digging around with netstat and tasklist and determining that the System process was what was responding to requests on ports 80 and 443, I had a thought I ought to have had earlier, and looked to see what happens when making a localhost request on the production server being copied. To my surprise it was the same thing: A 404 returned by something identifying itself as Microsoft-HTTPAPI/2.0...Which finally put the thought into my head that it might be related to the hostname in the IIS port binding.

Sure enough, when I edited those bindings to match the DNS name of the copy host, rather than the name of the server being copied, requests were handled by IIS and everything was back to normal as far as web service.

Another cautionary tale about a developer with little admin experience having to try to solve an admin-side mystery.

0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.