- Create a "KeepAlive" page; a simple page with a static, predictable response. I have created a simple page that displays the Site Name, Web Server Name, and Site IP Address:
- Implement a VBScript which makes an http request of the Keep Alive page, returning the response string. The script implements the Microsoft.XMLHTTP object. If the request does not resolve or returns an unexpected result, the script sends an email to the stakeholder (you).
- Implement an NT Scheduled Task to run the VBScript (#2) every five minutes. Hopefully, you'll never hear from the tool :)
Thursday, May 31, 2007
Site Monitoring - Simple Tool
Tuesday, May 29, 2007
ASPBufferingLimit - IIS5 vs. IIS6
First I ruled out the most obvious and usual offenders during a migration - code and data. Configuring the app on my development machine (IIS5), pulling down the production code and pointing to the production db, the app functioned swimmingly.
Moving on, I researched and came across an IIS ADSI property, "ASPBufferingLimit". Apparently IIS6 sets a lower constraint on the ASP Buffer than IIS5. Good for a healthy web server, but bad for some legacy apps.
The issue was resolved by upping the buffer limit on the IIS6 server. The server administrator accomplished this by running:
- c:\inetpub\adminscripts\adsutil.vbs set w3svc/aspbufferinglimit value
Friday, May 25, 2007
Enable IIS 6.0 Extensions using VBScript
- Set IIsWebServiceObj = GetObject("IIS://localhost/W3SVC")IIsWebServiceObj.EnableWebServiceExtension "ASP.NET v1.1.4322" IIsWebServiceObj.SetInfo
- Option explicit
dim IIsWebServiceObj
Set IIsWebServiceObj = GetObject("IIS://localhost/W3SVC")
'Enable Proprietary Extention
IISWebServiceObj.AddExtensionFile "c:\mydll.dll", true, "MyDLL", true, _ "MyProprietaryExtensions"
IIsWebServiceObj.SetInfo
wscript.echo "success!"
Wednesday, May 23, 2007
"Visual studio could not identify the version of ASP.NET on the Web server. Do you want to continue?"
- (Copy Project Interface; Options I chose to create a lean deployment directory...)
- (...And the mysterious warning)
Browsing Google and various Forums, I was led to believe that my .NET Framework/ASP.NET installs were somehow corrupt, and I would have to reinstall or run the aspnet_regiis.exe utility. This didn't sound right to me. I have functioning 1.1/2.0 apps in my development environment, and was able to execute the Copy Project for other 1.1 projects.
I beat myself up about this a bit, and then finally selected "Yes". VS.NET went ahead and built the deployment directory as specified, but not before presenting me with the following popup:
This prompt was familiar to me; it's what you see when an application does not have anonymous access enabled in IIS. Enabling anonymous access eliminated the original VS.NET error!
Hopefully this tip will save someone troubleshooting time or scalp hair.
Monday, May 21, 2007
Overriding Web.config Using Location Tag
Use the <location> tag in web.config to describe the settings for folders within the application.
Web.config Snippet
I have a web application set up in c:\inetpub\myapp, aka http://localhost/myapp. A snippet from web.config is illustrated here:
The application reads settings from the
MyApp Settings
The following screen shot illustrates the default behavior:
And here are the overrides, using the same test page under the /Test folder:
Piece of cake, huh? For the brief testconfig.aspx source code, visit the following link.
Friday, May 18, 2007
Developers: Friendly HTTP Errors can be Unfriendly
These "friendly" errors can mask a problem when troubleshooting. This is prevalent in ASP applications. The following app is missing a virtual directory, and the client has friendly errors turned on:
That doesn't really tell you much, does it? Now here's what we get with the option turned off:
That's a little more informative (minus the proprietary details), isn't it? Keep it unfriendly!
Thursday, May 17, 2007
Wednesday, May 16, 2007
Get To Know Your Hosts File
It is a plain text file located within your system directory. It has no file extension.
- Windows 2000 - c:\winnt\system32\drivers\etc\hosts
- Windows XP, 2003 - c:\windows\system32\drivers\etc\hosts
- You'll find equivalent files in other OS's (e.g. Unix)
Your Hosts file overrides DNS, forcing HTTP requests to route the way you specify.
Why is it Useful?
There are all kinds of uses for Hosts, depending on your problem at hand. Here are some examples:
- You set up numerous IIS sites (e.g. http://mysite.com) in a development environment (server OS), and want to test them via a browswer.
- You are developing a single site with multiple behaviors based on domain name (e.g. http://myBlueSite.com has a blue background; http://myRedSite.com has a red background). You want to be able to test these behaviors.
- Your are troubleshooting your company's load-balanced server farm. Customers are complaining about a site/application, but you are having difficulty recreating. If the problem is isolated to a specific server, you can force http requests to each server in the farm, provided you have the list of IP addresses.
- You want to block various ad/banner nuisances.
You are developing a fictional site to IIS, running Windows XP. Call this site http://diablolovessteak.com.
- Open c:\windows\system32\drivers\etc\hosts in a text editor
- Add the following line:
- 127.0.0.1 diablolovessteak.com
- Save the file.
- Close any open internet browsers.
- Open a browser and go to http://diablolovessteak.com
The request will open the home page of your default web site. If you've never used Hosts, give it a shot!
Monday, May 14, 2007
DNS For Dummies
If you are like me, application-heavy and network-light, then DNS is a relative mystery to you. A friend (network guy) gave me the following high level explanation.
You type and enter an address into your browser, e.g. http://diablopup.blogspot.com.
The first thing that happens is your computer asks your ISP's (e.g. AT&T's) DNS server (1) "do you know the IP address for this website?" If it does, it will tell your computer what it is, and you connect directly to the Website Server (3).
If your ISP's DNS server doesn't know, it will ask (in a roundabout way) the website owner’s DNS server for the IP address(2). Then it connects to the website server (3).
Once your ISP's DNS server knows the IP address, it keeps it in cache so it doesn't have to ask again, thereby making the connection quicker on subsequent requests. This is why you sometimes experience a slow page load when visiting a website for the first time, but then witness quicker connection on subsequent visits.
There are more "nuts and bolts" to DNS, but this is an intuitive picture for people who can't work with DNS directly.
Thursday, May 3, 2007
Installing a Windows Service
A few weeks ago I wrote a brief entry on Lewis Moten's Visual SourceSafe Journal Monitor. This tool runs as a windows service, polling the specified journal.txt every few minutes and updating a data source with the latest VSS changes.
This got me interested in windows services in general and how you set them up using VS.NET. Here is a link to another CodeProject article focusing on setting up a Windows Service project. It details:
- How to set up and build a simple Windows Service project.
- How to create a setup package (.msi) to install the Windows service.
I work for an organization where the administrators will not accept an .msi package. They want more visibility into what exactly you are trying to do to their production machines, since they are ultimately responsible for keeping them up and running.
Here's how you can install/uninstall a windows service .exe using VBScript .