IIS7 – post #13 – Failed Request Tracing (FREB) and my own version of FREB Tree Control (v0.01)

It has been a while since I geeked on IIS7.  I was checking out Mike Volodarsky blog for the latest and greatest on IIS7.   There was an article on FREB (Failed Request Event Buffer).  This feature has been politely renamed to Failed Request Tracing, I have a feeling FREB will stick around.   Mike pointed to an updated FREB.XSL.  This helps display requests in a more friendly format than using Notepad.  Here is the article by Bill Staples about this. Making Failed Request Tracing More Approachable  

I like viewing things in TreeControls so lets start a FREB Tree Control.  ?  This version displays the FailedReqLogFiles sub-folders with associating files in a TreeView.  You can click on the file and have it display in IE.  This version only works in IE.  Firefox pops up a message about not knowing how to display an XML file.  I’m sure there is a Firefox guru reading this post that knows how to resolve that. ?   Here is the code for the tree control.  You can download the code here.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<!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 runat="server">
    <title>Failed Request Tracing Tree Control</title>
    <form id="form1" runat="server">
        <h1>Failed Request Tracing Tree Control by Steve Schofield</h1>
        <table width="100%">
                <td style=’width:25%’ valign=’top’>
                     <asp:TreeView ID="TreeView1" runat="server" ExpandDepth=1>


Imports System.IO

Partial Class _Default
    Inherits System.Web.UI.Page

    Private Const LogRoot = "C:inetpublogsFailedReqLogFiles"

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        ‘On the first page visit, populate the photo tree and select the root node
        If Not Page.IsPostBack Then
        End If
    End Sub

    Private Sub PopulateTree()
        ‘Populate the tree based on the subfolders of the specified LogRoot
        Dim rootFolder As New DirectoryInfo(LogRoot)
        Dim root As TreeNode = AddFoldersToTreeView(rootFolder, Nothing)

        ‘Add the root to the TreeView
    End Sub

    Private Function AddFoldersToTreeView(ByVal folder As DirectoryInfo, ByVal parentNode As TreeNode) As TreeNode
        ‘Add the TreeNode, displaying the folder’s name and storing the full path to the folder as the value…
        Dim virtualFolderPath As String

        If parentNode Is Nothing Then
            virtualFolderPath = LogRoot
            virtualFolderPath = parentNode.Value & folder.Name & "/"
        End If

        Dim node As New TreeNode(folder.Name, virtualFolderPath)
        Dim subFolders As DirectoryInfo() = folder.GetDirectories()

        For Each subFolder As DirectoryInfo In subFolders
            Dim files As TreeNode = AddFilesToTreeView(subFolder)
        Return node     ‘Return the new TreeNode
    End Function

    Private Function AddFilesToTreeView(ByVal folder As DirectoryInfo) As TreeNode
        ‘Add the TreeNode, displaying the folder’s name and storing the full path to the folder as the value…
        Dim files As New TreeNode(folder.Name, folder.Name.ToString())
        For Each file As FileInfo In folder.GetFiles()
            Dim child As New System.Web.UI.WebControls.TreeNode
            child.Value = "<a href=’" & file.FullName.ToString & "’ target=’_blank’>" & file.FullName.ToString & "</a>"
        Return files     ‘Return the new TreeNode
    End Function
End Class

Here is an image of this running on my Longhorn server.


Steve Schofield
Microsoft MVP – IIS



I was looking at using some type of image verification on my website.   Here are some links with information about ‘CAPTCHA’.   Please pass along your tips and tricks when using this technology to stop spam bots, comment spam bots and other automated tools to submit  information to your site.

        Stopping Automated Web Robots Visiting ASP/ASP.NET Websites

        What is CAPTCHA?



IDS notes

I’ve been toying around with Snort (IDS) for windows.  Here are some major links.   

‘download winpcap

‘snort for windows

‘Textpad to read snort.conf (notepad doesn’t work)

‘download rules place in c:snortrules
1) register first
2) download / extract (The Official Snort Ruleset (registered user release)
3) download / extract Community Rules 

‘edit snort.conf
change 3 things
#var RULE_PATH ../rules
var RULE_PATH c:Snortrules

# dynamicpreprocessor directory /usr/local/lib/snort_dynamicpreprocessor/
 dynamicpreprocessor directory c:Snortlibsnort_dynamicpreprocessor

# dynamicengine /usr/local/lib/snort_dynamicengine/libsf_engine.so
 dynamicengine c:Snortlibsnort_dynamicenginesf_engine.dll


Search engine tips / tricks.

Every heard the question; How do I get my site to come up in the search engines?  This is a real art-form rather than a silver bullet.  Best thing you can do is have people on other sites link to your site.  It doesn’t hurt to submit to http://www.Google.com, http://www.Yahoo.com.  These are free and usually can help generate some traffic.   Additional items is have a robots.txt located in the root of the folder, as many key words as possible in the meta-tag key words.  I’m not sure how effective using keywords in meta-tag headers, it sure can’t hurt. ?

None of these techniques will ensure you top position in Google right away unless you are willing to pay for click option.  This can be rather costly and proceeding with caution is recommended.  A few other options is to have some general based text in the Title of his page because that is usually what shows up in a search result.  There are other *free* services that will submit your site to a lot of the search engines but the main ones like Yahoo, Google, MSN, Alta-Vista are good ones to start with.  If you have a few tricks to pass along, let me know.

The Web Robots Pages

Webmaster Help Center

Yahoo Help

How To Use HTML Meta Tags


Steve Schofield
Microsoft MVP – IIS

IIS7 compression info

I just posted a blog about IIS6 compression.  I was wondering if IIS7 compression was much different.  After some searching, here are some links I found regarding IIS7 compression.  I enabled this successfully on my IISLogs.com server and is working great.  A quick search on Technet doesn’t have any IIS7 compression info.

Migrating an ASP.NET app to IIS 7

Changes to compression in IIS7

IIS Compression by Bernard Cheah



IIS6 compression links

Here are a few good links on IIS 6 compression.  

IIS6 compression by Scott Forsyth

Enabling HTTP Compression

Customizing the File Types IIS Compresses