locked
PDC session demo question with Managed Fusion RRS feed

  • Question

  • Did any watch or attend the recent PDC session on Windows Homeserver with CJ Saretto, Brendan Grant and Doug Berrett. Called Exposing Connected Home Services to the Internet Via Windows Home Server ?

    I am trying to replicate what CJ Saretto did in his demo, using Managed Fusion with Windows Homeserver, as a web proxy to connect to another machine in my network. Exactly what he did. I have followed every step that CJ did in his demo but am getting nowhere, when I click on my link I get "You are not authorized to view this page" HTTP error 401.3

    I have followed his demo to the letter and it still displays this message. 

    Can someone help me out? What am I doing wrong, or have I or CJ missed something?

    Thanks 
    Saturday, November 8, 2008 12:22 PM

Answers

  • OK,
    Got it figured out (if anyone is interested, I can post more details on how-to)

    Some hints:
    Make sure the website on the external server is configured for a port that is not accesible from the outside (e.g port 90) and has anonymous access.
    • Best use the new website wizard to create one. After running the wizard, check/set .NET Framework 1.1 or 2.0 when appropriate.
    • Set the default page (e.g. default.asp or index.htm)
    • Do not forget to open the firewall for port 90
    • Set directory access for the directory containing the website files (add account IUSR_.....)

    Important: Confirm that you are now able to access the new site as http://externalserver:90/ without authenticating.

    Next:

    On the WHS server, create a new virtual directory named {sitename} under the WHS remote site (Default Web Site -> Remote, right-click->new) and point it to the directory created at  "C:\Inetpub\remote\{sitename}".
    Make sure the new website in configured for .NET 2.0 and security setting "anonymous access" only.

    Insert aspnet_isapi.dll ( {sitename}'s Virtual directory tab ->Configuration)

    At "C:\Inetpub\remote\{sitename}":

    • Create a directory bin and copy the files ManagedFusion.Rewriter.dll/pdb
    • Create the files ManagedFusion.Rewriter.rules and web.config

      RewriteEngine on  
      RewriteBase /remote/fotosite/  
      RewriteRule ^(.*)$ http://server:90$1 [P]  
       

    • <?xml version="1.0"?>  
      <configuration> 
       
      <configSections> 
        <sectionGroup name="managedFusion.rewriter" type="ManagedFusion.Rewriter.Configuration.ManagedFusionSectionGroup, ManagedFusion.Rewriter">  
          <section name="rules" type="ManagedFusion.Rewriter.Configuration.RulesManagerSection, ManagedFusion.Rewriter"/>  
        </sectionGroup> 
        </configSections> 
            
        <managedFusion.rewriter> 
          <rules fileName="ManagedFusion.Rewriter.rules" rebaseClientPath="false" rewriteFormPostBack="true" /> 
        </managedFusion.rewriter> 
       
        <system.web> 
          
        <machineKey validationKey="..." decryptionKey="..." 
         validation="SHA1" decryption="AES" /> 
           
        <authentication mode="Forms">  
           <forms name="RemotePortalAuth" loginUrl="..\logon.aspx" protection="All" path="/" timeout="12000" requireSSL="false"/>  
        </authentication> 
       
        <httpModules> 
           <add name="RewriterModule" type="ManagedFusion.Rewriter.RewriterModule, ManagedFusion.Rewriter"/>  
        </httpModules> 
       
        </system.web> 
       
      </configuration> 

    Finally, add your site to the WHS remote page by editting the "C:\Inetpub\remote\WebSites.xml"

    Theo.


     


    No home server like Home Server
    Monday, November 10, 2008 10:00 PM
    Moderator

All replies

  • I have been trying this for 4 hours now,  removed the authentication in the web.config but my rewrites fail to work correctly on my internal sites :(

    the /Remote/site keeps popping up in my remote site


    and return urls(??) are an issue also

    logon.aspx?ReturnUrl=%2fRemote%2fsite%2fRemote%2site


    • Edited by hoberion Saturday, November 8, 2008 5:31 PM
    Saturday, November 8, 2008 5:14 PM
  • I haven't yet viewed that video, but I would recommend you start with a completely vanilla Windows Home Server installation. Usually those sorts of demos start with a sanitized (or nearly so) build.

    If you can't set up physical hardware, you can use Microsoft Virtual PC to install a copy of Windows Home Server in a virtual machine.
    I'm not on the WHS team, I just post a lot. :)
    Saturday, November 8, 2008 5:56 PM
    Moderator
  • Mattyg76 said:

    Did any watch or attend the recent PDC session on Windows Homeserver with CJ Saretto, Brendan Grant and Doug Berrett. Called Exposing Connected Home Services to the Internet Via Windows Home Server ?

     

    Yes I did (and it's one of my favorite sessions :-)
    This week I did try it (proxying to an external server in the same workgroup) but run into problems due to authorization problems (I think this is what you are experiencing also). Haven't had the time since to sort this out.

    Sorry (this is not really helping), hope to investigate this in more detail next week.

    (Btw - I would recommend Ken Warrens suggestion trying it out first in a Virtual server environment)

    Theo.



    No home server like Home Server
    Saturday, November 8, 2008 6:47 PM
    Moderator
  • Yes Ken, it is fairly vanilla, if you call only backing up one PC and only one add-in instaled, vanilla. Love to know whats going on with this if anyone can work it out, or if someone knows CJ's email address I could drop him an email asking him to explain in more detail.
    Sunday, November 9, 2008 12:25 AM
  • Send me your email address and I'll pass it along. Mine is in my profile; just remove the antispam device.
    I'm not on the WHS team, I just post a lot. :)
    Sunday, November 9, 2008 3:24 AM
    Moderator
  • ken, could you please ask him to post a howto on doing this with webguide? Since florence is unreleased.
    Sunday, November 9, 2008 7:55 AM
  • hoberion said:

    logon.aspx?ReturnUrl=%2fRemote%2fsite%2fRemote%2site



    (Btw: You did not forget to "insert" aspnet_isapi.dll for the virtual site created for /Remote/site? See MangedFusion readme.txt)

    • Over here rewrites work just fine when proxying a plain website on the local server.
    • When running the proxied site on a directory in the WHS shares, it has no access to the website's files unless one add's additional access privileges for the share (unsupported, but for testing purposes "all authenticated users" worked for me).  Not a real solution as WHS resets these settings when changing user access to the share.
    • Running a proxy on a remote machine does not work due to authentication problems I did not solve yet.
      I suppose this could be easily solved when both machines were in a domain configuration (Didn't try but I think maybe this could be solved by added an identical user/password combination on both machines).

    So in a nutshell: it ll has to do with setting the right access privileges?
    Theo.


    No home server like Home Server
    Sunday, November 9, 2008 8:17 AM
    Moderator
  • Passed along. I'm making no promises, though; see my .sig for why. :)
    I'm not on the WHS team, I just post a lot. :)
    Sunday, November 9, 2008 3:23 PM
    Moderator
  • OK,
    Got it figured out (if anyone is interested, I can post more details on how-to)

    Some hints:
    Make sure the website on the external server is configured for a port that is not accesible from the outside (e.g port 90) and has anonymous access.
    • Best use the new website wizard to create one. After running the wizard, check/set .NET Framework 1.1 or 2.0 when appropriate.
    • Set the default page (e.g. default.asp or index.htm)
    • Do not forget to open the firewall for port 90
    • Set directory access for the directory containing the website files (add account IUSR_.....)

    Important: Confirm that you are now able to access the new site as http://externalserver:90/ without authenticating.

    Next:

    On the WHS server, create a new virtual directory named {sitename} under the WHS remote site (Default Web Site -> Remote, right-click->new) and point it to the directory created at  "C:\Inetpub\remote\{sitename}".
    Make sure the new website in configured for .NET 2.0 and security setting "anonymous access" only.

    Insert aspnet_isapi.dll ( {sitename}'s Virtual directory tab ->Configuration)

    At "C:\Inetpub\remote\{sitename}":

    • Create a directory bin and copy the files ManagedFusion.Rewriter.dll/pdb
    • Create the files ManagedFusion.Rewriter.rules and web.config

      RewriteEngine on  
      RewriteBase /remote/fotosite/  
      RewriteRule ^(.*)$ http://server:90$1 [P]  
       

    • <?xml version="1.0"?>  
      <configuration> 
       
      <configSections> 
        <sectionGroup name="managedFusion.rewriter" type="ManagedFusion.Rewriter.Configuration.ManagedFusionSectionGroup, ManagedFusion.Rewriter">  
          <section name="rules" type="ManagedFusion.Rewriter.Configuration.RulesManagerSection, ManagedFusion.Rewriter"/>  
        </sectionGroup> 
        </configSections> 
            
        <managedFusion.rewriter> 
          <rules fileName="ManagedFusion.Rewriter.rules" rebaseClientPath="false" rewriteFormPostBack="true" /> 
        </managedFusion.rewriter> 
       
        <system.web> 
          
        <machineKey validationKey="..." decryptionKey="..." 
         validation="SHA1" decryption="AES" /> 
           
        <authentication mode="Forms">  
           <forms name="RemotePortalAuth" loginUrl="..\logon.aspx" protection="All" path="/" timeout="12000" requireSSL="false"/>  
        </authentication> 
       
        <httpModules> 
           <add name="RewriterModule" type="ManagedFusion.Rewriter.RewriterModule, ManagedFusion.Rewriter"/>  
        </httpModules> 
       
        </system.web> 
       
      </configuration> 

    Finally, add your site to the WHS remote page by editting the "C:\Inetpub\remote\WebSites.xml"

    Theo.


     


    No home server like Home Server
    Monday, November 10, 2008 10:00 PM
    Moderator
  • Thanks Theo, this all very good if your remote machine is running windows with IIS, what if you want to connect to a webserver running linux. Or a settop box that has it's own webserver, router config page ect,  thats what I'm trying to achive, I have a few devices in my home that publish their information via a webpage. I access these but typing their ip address straight into my browser, one example is http://192.168.1.4/index.htm   this is what I am trying to get on my homeserver.
    Tuesday, November 11, 2008 3:51 AM
  • Mattyg76 said:

    Thanks Theo, this all very good if your remote machine is running windows with IIS, what if you want to connect to a webserver running linux. Or a settop box that has it's own webserver, router config page ect,  thats what I'm trying to achive, I have a few devices in my home that publish their information via a webpage. I access these but typing their ip address straight into my browser, one example is http://192.168.1.4/index.htm   this is what I am trying to get on my homeserver.

    If you can connect to the Url without authenticating it should work.
    If you _do_ need some form of authentication I think you need some additional programming.


    No home server like Home Server
    Tuesday, November 11, 2008 7:54 PM
    Moderator
  • Wow this is great, I had no clue that my URL Rewriter was used in a PDC demo.  Be on the look out for version 3.0 which should hit sometime in April.  By the way if you want a much quicker response through the proxy set the  rewriteFormPostBack = "true" to false in web.config.
    Friday, April 3, 2009 11:47 AM