June 1, 2010
Been diagnosing a problem between a SOLR index job and an IIS RESTful web service. At some point in the batch something bad happens and I don’t know what it is. I wanted to have a real-time monitor in place and tried to get fiddler up and running to monitor the http requests coming into IIS.
I could only do this by setting up a reverse proxy, having fiddler run on port 80 and redirect to port 81 to which IIS would be running. I did run into a snag, IIS still kept a hold on port 80 until I ran the below command line..
netsh http add iplisten ipaddress=x.x.x.x
1) stop all IIS services: net stop http /y
2) have IIS listen only on the IP address I’d designated for IIS: netsh http add iplisten ipaddress=x.x.x.x
3) restart IIS Services: net start w3svc
That allowed fiddler to run on port 80 and then redirect the responses to IIS. Then I got to see where the problem was. I tried wireshark, but I didnt need “capture” I only wanted streaming…
May 28, 2010
I finally switched back to Linux after a long hiatus. Things have gotten so much better with Ubuntu since I last checked out 7.04. My college at work turned me to VirtualBox hosting Windows and the seamless integration mode they have, so I decided to give it a try tonight.
I did get a very odd error when trying to install right when it was expanding windows files. I searched for a long time trying to find the answer and I tried many different disk images and burnt images that I knew just had to work.
c:\windows\winsxs is corrupt 0x80070570
In short the solution to this was to go into VirtualBox settings for the VM and change the storage to be 100% IDE based and not use the RAID driver that comes with it. It seems the SATA controller it provides to the windows installer is busted. If you remove it from your system configuration, and instead attach your virtual hard drive to the IDE controller, your installation will actually work.
May 5, 2010
Was tinkering with power-shell today to finish up an automated build environment that handles 12+ WCF services. When I stumbled onto a large issue (read: I am a novice powershell user). I could not effectively open powershell and set the defaultProtocols required to enabled net.msmq, net.tcp.
After a bit of searching I ended up with the below solution. It seems to work well enough. I’m trying to get a demo together of an automated build and deploy which handles the entire process of taking servers out of the load balancer gracefully bleeding current requests, and then deploying, and updating. But that is for another day…
Enjoy the powershell goodness…
Import-Module WebAdministration
$fqn = Read-Host "Enter Domain Name (ie test.com)"
Write-Host -ForegroundColor green "Creating Directory C:\inetpub\wwwroot\$fqn..."
New-Item C:\inetpub\wwwroot\$fqn -type Directory
Write-Host -ForegroundColor green "Creating AppPool IIS:\AppPools\$fqn..."
New-Item IIS:\AppPools\$fqn
$pool = Get-Item IIS:\AppPools\$fqn
$pool.processModel.userName = "DOMAIN\USERID"
$pool.processModel.password = "P@SSW0RD"
$pool.processModel.identityType = 3
$pool.managedRuntimeVersion = "v4.0"
$pool | Set-Item
Write-Host -ForegroundColor green "Creating Website IIS:\Sites\$fqn..."
$dns = ":80:" + $fqn
New-Item iis:\Sites\$fqn -bindings @{protocol="http";bindingInformation=$dns} -physicalPath c:\inetpub\wwwroot\$fqn
Write-Host -ForegroundColor green "Adding NET.TCP to IIS:\Sites\$fqn..."
New-ItemProperty IIS:\sites\$fqn -name bindings -value @{protocol="net.tcp";bindingInformation="8080:$fqn"}
Write-Host -ForegroundColor green "Enabling [http,net.tcp,net.msmq] protocols on IIS:\Sites\$fqn..."
Set-ItemProperty IIS:\Sites\$fqn -name applicationDefaults.enabledProtocols -value "http,https,net.tcp,net.msmq"
Write-Host -ForegroundColor green "Assigning AppPool to IIS:\Sites\$fqn..."
Set-ItemProperty IIS:\Sites\$fqn -name applicationPool -value "$fqn"
Removing a Site
Removing a site is pretty basic right now, in time, when I have some and can get over the cold I’d like to take this to the next level by setting up a job to take the site offline and have the load balancer bleed people off…
Import-Module WebAdministration
$fqn = Read-Host "Enter Domain Name (ie test.com)"
Write-Host -ForegroundColor green "Removing AppPool $fqn..."
Remove-Item IIS:\AppPools\$fqn -recurse
Write-Host -ForegroundColor green "Removing IIS Site $fqn..."
Remove-Item IIS:\Sites\$fqn -recurse
Write-Host -ForegroundColor green "Removing Directory c:\inetpub\wwwroot\$fqn..."
Remove-Item c:\inetpub\wwwroot\$fqn -recurse