+ Reply to Thread
Results 1 to 3 of 3

Thread: Httphandler & Virtual Directory

  1. #1

    Question Httphandler & Virtual Directory

    Well, now that I finally got the host.service running, I had to realize that what I really needed was the HttpHandler. Bad luck, but at least I will know it for the future Or does anyone knows a way how to get run the service on the same port as IIS (80) without interfering?

    The problem I am facing is that the site is access directly and through a proxy. Unfortunately, this proxy only accesses pages on this very server on port 80. So the solution I am thinking about is using the HttpHandler and provide the service functionality in a VirtualDirectory.

    So far I got Dream running without any error messages - until I try to actually access a service. No matter what service I try, the log states, that the feature could not be found. my config looks like:
    Code:
    	<appSettings>
            <add key="service-dir" value="C:\DreamServer" />
    		<add key="root-uri" value="http://localhost/services"/>
    		<add key="apikey" value="12345"/>
    		<add key="script" value="C:\DreamServer\startup.xml" />
        </appSettings>
    I tried several settings but did not really manage to get rid of the problem. So any ideas why this isn't working? I cannot even call the host service to check any configuration options.

  2. #2

    Exclamation

    Ok, I am not sure if my solution really is the best one, or if I simply doing something wrong, but I could not figure out how to set the "host-path" for the DreamHost instance launched by the HttpHandler.
    I checked the source and I thing it is simply a matter of adding one line to the source. It might be just a hack, but at least this way it is working for me

    I replaced the following code in mindtouch.core > http > httphandler.cs

    Code:
    XDoc config = new XDoc("config")
        .Elem("service-dir", ConfigurationSettings.AppSettings["service-dir"])
        .Elem("apikey", apikey);
    with

    Code:
    XDoc config = new XDoc("config")
        .Elem("service-dir", ConfigurationSettings.AppSettings["service-dir"])
        .Elem("host-path", ConfigurationSettings.AppSettings["host-path"])
        .Elem("apikey", apikey);
    This way the "host-path" configuration is read from the webconfig appSettings section and passed onto the launched DreamHost process.

  3. #3
    Join Date
    Jul 2006
    Location
    San Diego, CA
    Posts
    5,450

    Default

    That's probably the easiest fix. I applied it locally as well. However, going forward, I think it would be better if the HttpHandler startup code would borrow from the console host and service host startup code paths. Both now rely on an external XML document that contains all relevant settings. This document could either be co-located with the dream.dll or be specified inside app settings.
    Steve G. Bjorg - Chief Architect
    Did you check the MindTouch FAQ?
    Found a bug? Report it.
    Follow me on Twitter
    Find us on IRC: irc.freenode.net #mindtouch

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts