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

Using ASP.Net Forms Authentication on Load Balanced Servers

We recently started using HAProxy to load balance between two application servers for both HTTP and HTTPS traffic. It was really easy to get working, has worked great so far and we’re really pleased with it. The only issue we had was with our login cookies, which are set via FormsAuth, as when logging in our visitors use HTTPS and might get a different server to the one they were ‘stuck’ to with HTTP which uses a cookie to ensure the same server. HAProxy can’t read a cookie from an SSL stream as…

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

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