Steve Schofield's Blog

March 2007 - Posts

  • Perfmon reference articles

    I'm working on some perfmon issues related to sql server.  Here are a few links with articles covering which perfmon counters and values should be used.  If you are in a position where you have to troubleshoot these types of things, this is a must read.  A fellow co-worker passed along the first two, which are really good.

  • Misc IIS links with great info

    I was looking for some IIS related information and ran across some 'great' links.   I wanted to post them for future reference. 

    Sample scripts for managing Web sites on Internet Information Server 6.0.
    http://www.microsoft.com/technet/scriptcenter/scripts/iis/iis6/default.mspx?mfr=true

    Sample scripts for managing the SMTP mail server included with Internet Information Server 6.0.
    http://www.microsoft.com/technet/scriptcenter/scripts/iis/iis6/default.mspx?mfr=true

    IIS7 SDK information
    http://msdn2.microsoft.com/en-us/library/aa830049.aspx

     

  • Want help with IIS SMTP Service? Please enable logging.

    When you trying to troubleshoot SMTP delivery issues and using Microsoft IIS SMTP Service.  One tip, the logging is not enabled by default.  I'm not sure why, but it can provide a ton of great information.  Pictures are worth a thousands words.  It can be done in three easy steps using IIS manager.  So the next time you have mail delivery issues, enable logging, send some test emails and see what is logged.  Notepad is a required tool for viewing them.   You can even use Logparser to query the files.  FINDSTR is my favorite quickie tool to locate information.   Impress yourself and your admin with this information the next time you have mail delivery issues.

    Note: This is not enabled by default.

    Step 1 - Enable logging

    Step 2 - this shows where the logs are located

    Step 3 - Enable all the fields so the maximum amount of information is logged

  • IIS SMTP links

    Here are some SMTP links I found that could be helpful.

    SMTP Queue Backup Occurs Due to Delivery Threads Attempting to Connect to Unavailable Hosts
    http://support.microsoft.com/kb/264891

    Great resource for mail related things
    http://www.msexchange.org

    Google is your friend
    http://www.google.com/search?hl=en&q=site%3Asupport.microsoft.com+iis+smtp

    DNSStuff.com - This is the Google of DNS troubleshooting sites.  The best hands down!
    http://dnsstuff.com

     

  • Speaking at Grand Rapids, MI .NET user group - Tuesday, March 20th

    I'll be speaking at Grand Rapids MI .NET user group on Tuesday, March 20th.  http://grdotnet.org/MeetingInfo/default.aspx  

    Topic: Web Development on Web Farms
    When: March 20 (6pm) at Watermark Country Club

  • IIS7 - post #33 - 12,902,327 seconds

    12 902,327 seconds (149.3 days by my calculator) is how long my Longhorn RC1 / IIS7 machine was up before it had to be rebooted.  http://iislogs.com is running on this server.  That is not too bad for a beta OS. :)  I was working on Remote Management Service testing and turned off the Windows Firewall.  I guess that is what I get for turning off the firewall. 

  • Localhost connection issues list

    I've been hanging in the forums and newsgroup recently.  There have been a variety of posts stating, I can't browse Localhost or http://127.0.0.1   There has not been any pattern to resolve it.  This post is dedicated to this very common issue.  If you have a solution not listed, please provide a comment and we'll add it to the list.  Hope this helps you if the problem is happening.. 

    1) Make sure the WWW service is enabled

    2) Verify you can ping localhost and resolve to 127.0.0.1

    3) Try adding localhost to trusted sites in IE.

    4) Do you get this behavior with Firefox and IE both?

    5) Open a command prompt, type netstat -an -p tcp and see if 0.0.0.0:80 listed or something with :80 listed.

    6) If IIS is not started and you see port 80 listed in #5.  It could be another service, such as Skype as another poster mentioned taking up the TCP port 80

    7) Verify you don't have a virus software or spyware program blocking access.

    8) Anything in the event logs showing an error.

    9) Run Filemon or Process Monitor from sysinternals.  this can help show which files or folders don't have access.

     

  • Searching Live.com and Google.com tip

    Maybe this is something everyone knows but me. :)  Thanks to Tom Kaminski IIS MVP and http://www.iistoolshed.com creator, he reminded me of a quick search tip.  Wow!  I wanted to pass this along.  Note, this is not intended to compare http://Google.com to http://Live.com.   The results were similar.

    site:support.microsoft.com iis ssl

    site:support.microsoft.com iis debug

    site:support.microsoft.com iis host-header

    site:support.microsoft.com iis ssl

    site:support.microsoft.com iis httpcfg

  • List files using Tasklist from the command prompt

    I've been hanging out in the forums over at http://forums.iis.net.  A person was having an issue where a 3rd party product potentially was causing an issue.  You can use Process Explorer from Sysinternals.  If you know which service the DLL is potentially loaded, you can use tasklist /M /FI "Services eq inetinfo".   This shows what files are associated with that process.  I thought I'd pass this along. 

    Image Name                     PID Modules
    ========================= ======== ============================================
    inetinfo.exe                   676 ntdll.dll, kernel32.dll, ADVAPI32.dll,
                                       RPCRT4.dll, msvcrt.dll, IISUTIL.dll,
                                       USER32.dll, GDI32.dll, ole32.dll,
                                       CRYPT32.dll, MSASN1.dll, USERENV.dll,
                                       Secur32.dll, WS2_32.dll, NSI.dll,
                                       IMM32.DLL, MSCTF.dll, LPK.DLL, USP10.dll,
                                       rpcref.dll, IisRTL.DLL, iisadmin.dll,
                                       COADMIN.dll, OLEAUT32.dll, PSAPI.DLL,
                                       AUTHZ.dll, ADMWPROX.dll, IISCFG.DLL,
                                       ATL.DLL, abocomp.dll, HTTPAPI.dll,
                                       WSOCK32.dll, nativerd.dll, XmlLite.dll,
                                       IISRES.DLL, NTMARTA.DLL, WLDAP32.dll,
                                       SAMLIB.dll, CLBCatQ.DLL, metadata.dll,
                                       MPR.dll, msxml3.dll, SHLWAPI.dll,
                                       comctl32.dll, rsaenh.dll, SHELL32.dll,
                                       mlang.dll, rsca.dll, svcext.dll, wamreg.dll

  • IIS7 post #32 - Web Application Stress Tool on Vista

    I was messing around with Powershell and IIS7 trying to list the executing requests.  Since my local environment isn't very busy, I loaded Web Application Stress Tool.   This tool has no problem generating enough requests.  You'll need to load one DLL called msvcp50.DLL not include with Vista.   The installer looks for this DLL.

    I created a Default.asp page that writes the Date / time and hit this with WAST.

    <% response.write Now() %> 

    Here is the Powershell script

    [System.Reflection.Assembly]::LoadFrom( "C:\windows\system32\inetsrv\Microsoft.Web.Administration.dll" )
    $sm = new-object Microsoft.Web.Administration.ServerManager
    $sm.workerprocesses | foreach-object {$_.GetRequests(0)}

    Here is the WAST Settings

    Here is the output from the powershell script

  • My first HTTP Module / HTTP Handler example using IIS7 / Vista

    Here is my first example using HTTP Module and HTTP Handlers with IIS7 in integrated mode.  Note, you can debug your application in 'integrated mode', which is really cool!  You'll need to follow this article to enable debugging.   This is one of the powerful things in IIS7.   You can also try out some URL-rewriting tricks.  Here is an article from Scott Guthrie

    App_Code/httpmodule1.vb (place in App_Code folder)
    -----------------------

    Imports Microsoft.VisualBasic

    Public Class TopHTTPModuleNameSpace
        Implements IHttpModule

        Public ReadOnly Property ModuleName() As [String]
            Get
                Return "TopHTTPModuleNameSpace"
            End Get
        End Property

        ' In the Init function, register for HttpApplication
        ' events by adding your handlers.
        Public Sub Init(ByVal application As HttpApplication) _
                Implements IHttpModule.Init
            AddHandler application.BeginRequest, _
                AddressOf Me.Application_BeginRequest
            AddHandler application.EndRequest, _
                AddressOf Me.Application_EndRequest
        End Sub

        Private Sub Application_BeginRequest(ByVal source As Object, _
                ByVal e As EventArgs)
            ' Create HttpApplication and HttpContext objects to access
            ' request and response properties.
            Dim application As HttpApplication = CType(source, _
                HttpApplication)
            Dim context As HttpContext = application.Context
            context.Response.Write("<html>" & vbCrLf)
            context.Response.Write("    <body>" & vbCrLf & vbCrLf)
        End Sub

        Private Sub Application_EndRequest(ByVal source As Object, _
                ByVal e As EventArgs)
            Dim application As HttpApplication = CType(source, _
                HttpApplication)
            Dim context As HttpContext = application.Context
            context.Response.Write(vbCrLf & vbCrLf & "    <body>" & vbCrLf)
            context.Response.Write("</html>" & vbCrLf)
        End Sub

        Public Sub Dispose() Implements IHttpModule.Dispose
        End Sub
    End Class


    App_Code/httphandler1.vb (place in App_Code folder)
    Imports System.Web

    Namespace HandlerExample
       
        Public Class MyHttpHandler
            Implements IHttpHandler
           
            ' Override the ProcessRequest method.
            Public Sub ProcessRequest(context As HttpContext) _
            Implements IHttpHandler.ProcessRequest
           
                context.Response.Write("<H1>This is an HttpHandler Test.</H1>")
                context.Response.Write("<p>Your Browser:</p>")
                context.Response.Write("Type: " & context.Request.Browser.Type & "<br>")
                context.Response.Write("Version: " & context.Request.Browser.Version & "<br>")

                If context.Request.Browser.AOL = True Then
                    context.Response.Write("IsAOL: True")
                Else
                    context.Response.Write("IsAOL: False")
                End If
            End Sub
           
            ' Override the IsReusable property.       
            Public ReadOnly Property IsReusable() As Boolean _
            Implements IHttpHandler.IsReusable
           
                Get
                    Return True
                End Get
            End Property
        End Class
    End Namespace

    Web.config
    <?xml version="1.0"?>
    <configuration>
     <appSettings/>
     <connectionStrings/>
     <system.web>
      <authentication mode="Windows" />
      <compilation debug="true"/>
     </system.web>
     <system.webServer>
      <modules>
            <add name="debugassistant" />
            <add name="TopHTTPModuleNameSpace" type="TopHTTPModuleNameSpace"/>
      </modules>
      <handlers>
            <add name="DebugHandler" path="DebugAttach.aspx" verb="DEBUG" type="System.Web.HttpDebugHandler"/>
            <add name="TheHTTPHandler" verb="*" path="Default.aspx" type="HandlerExample.MyHttpHandler"/>
      </handlers>
     </system.webServer> 
    </configuration>

    'Default.aspx test page
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
    <title>My Handler Page Not executing</title>
    </head>
     <body>
      <form id="form1" runat="server">
       <div>
       <% =(Now())%>
       </div>
      </form>
     </body>
    </html>

  • How to use a Hosts file to test a site that uses host headers on an Intranet (and Internet)

    This can be used to test your site changes without publishing to a remote server. 

    http://support.microsoft.com/kb/228760/en-us


Powered by Community Server 2.1