IIS 7.x "404 - File or directory not found" for .iso image files

If you get the following message when trying to download an .iso disc image from IIS 7/7.5… 404 – File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable. You just need to add the MIMI type. To do this, open IIS Manager, select the server on the left, open MIME Types… Then on the top right click Add > File name extension: .iso MIME Type: application/octet-stream The file should now download pr…

Read More

Add a virtual directory to multiple sites in IIS 7.x using PowerShell.

Someone needed to add virtual directory to a few dozen sites in IIS, so I wrote them a little script to do it. To use it save the code below as something like ‘CreateVirDirs.ps1’, open a Powershell prompt with administrator rights, cd to the directory you saved it in and then execute it with .CreateVirDirs.ps1 Import-Module WebAdministration $sites = Get-Childitem 'IIS:Sites' $name = "NewVirtualDirectory" $vdPath = "D:Temp" foreach ($site in $sites) { $path = 'IIS:Sites' + $site.Name + '' + $n…

Read More

Microsoft AppFabric vs Redis (Windows port)

The traffic of our football news syndicating website (Kick News) has been steadily growing a lot since it launched. When we redeveloped it a couple of years ago, we used an in-process cache, by creating an IQueryable extension method that uses an md5 hash of the underlying SQL query as the key. This worked reasonably well, but has it’s obvious problems, such as the caches needing to be refilled when the app pool recycles or when the server is restarted. On our busy site, this means we had to wai…

Read More

MJ12bot and blocking web crawlers with IIS 7

Our web servers were recently getting hit pretty hard by web crawler bots that simply ignore your Robots.txt file. We were getting hit especially hard by a bot called MJ12bot, which is supposed to be for a distributed search engine which they say lives in an alpha state at search.majestic12.co.uk (at the time of writing that is down). It seems they get people to run their SETI@Home like software that uses your power, CPU and bandwidth to help them build what they say is a distributed search engi…

Read More