You are currently browsing the tag archive for the ‘IIS7’ tag.

On and off for the last couple of months I have been learning Erlang.  My primary source for this is a decent booked named, “Learn You Some Erlang for Great Good!” (Fred Hebért, (c)2013 no starch press). What a great name, no starch press (:  I first found this tutorial online at http://learnyousomeerlang.com/.  The entire book is there, believe it or not.  I worked through the first few chapters and was hooked.  I decided to purchase the book to help pay for the work and for it to be more convenient to read.  But I digress, back to IIS & Mercurial.

Mercurial Logo

The whole reason for the Erlang digression is that I was going through examples in the book on different computers.  After I was done with the session I would have copy my practice files back to my home server, which was a pain on a disconnected Linux box.  To solve this, I figured, why not setup a repo at home.  I have been wanting to do this for a while anyhow.  Now I could setup an SVN repo in a few minutes, but I don’t really use SVN anymore (“It’s so 1990’s (:  ).  Mercurial is my DSCM of choice.  I have nothing against GIT, and do use it, I just regularly use Mercurial.

IIS7 logo

My home server is Microsoft Windows Home Server 2011.  Basically Windows 2008 R2 (IIS 7.5) with some other “stuff” thrown in.  Finding installations for a Mercurial server under Windows is not a simple task.  There are articles out there, most of them are old or incomplete.

This walk-through, http://www.jeremyskinner.co.uk/mercurial-on-iis7/ [Jeremy’s article], is good and walks well through the process.  Unfortunately it is out of date and doesn’t cover well what needs to be installed today to get this to work.  The first part of my pain as things weren’t working.  I am thankful for its explanation of adding CGI support in IIS7, something I haven’t needed to do in IIS7 before.  One thing this article mentions (in bold) is to use x86 installer of Python, even if your machine is 64-bit.  I believe this is no longer accurate as I installing 64-bit Mercurial and 64-bit Python and all is working fine.

For the start of my journey I was using this walk-through along with a few Mercurial wiki pages: http://mercurial.selenic.com/wiki/HgWebDirStepByStep and http://mercurial.selenic.com/wiki/PublishingRepositories.  I was understanding how the publishing works, but not getting things to work on my Windows server.  Mostly my error was around Python not being able to find hgweb stuff.  It was blowing up on application = hgweb(config), and said application undefined. The additional Mercurial installation I needed was located here: http://mercurial.selenic.com/wiki/Download#Windows which I found in a helpful wiki artical, http://mercurial.selenic.com/wiki/HgWebInIisOnWindows.  If you follow this article straight through, you will almost have a successful installation.  What I learned from this page is that the Python module installer needs to be run.  This adds Mercurial modules to Python.  Something which is needed and not specified in the other installation instructions.

If you don’t like the command line, the IIS configuration in the Mercurial wiki article is done through the command line.  You can reference how to do these through the UI using Jeremy’s article.

My suggestion after going though this, this morning is to use both articles.  Read through them first, before installing anything, then plan your attack and go for it. Oh and yeah, you’ll need to refer to the Publishing Repositories wiki page.

New hg site

A few things I learned from this morning’s adventures

  • Within the hgweb.config file the section [collections] is no longer needed, the section [paths] may be used instead.  There is more information around this here: http://mercurial.selenic.com/wiki/PublishingRepositories
  • Within hgweb.config a path of / = /path/to/repo/* will show (publish) all repositories.
  • Withing hgweb.config using allow_push = * allows any user to push to the repository. Using this settings negates the need to enable authentication on the web.  Yes this makes things insecure, but my setup is internal to my house only.

So sure this took a bunch of hours to figure out and get working correctly.  Though now it is working correctly and I have my working Mercurial repository like I have been wanting for some time. Plus I have learned a bunch of stuff too.  Perhaps I’ll go play a game now.

I learned something new over the last week which I not exactly sure of the benefit of.  Probably because I still not entirely sure on how it is implemented.

It seems that in IIS7 that the default functionality is that the web.config in the root website is inherited to the child webs.

Of course I found this the hard way.  I changed to a new web host and while setting up my base sites I wanted to try out a few new applications.  I setup Umbraco under a sub-domain and played around with that for a while and remembered Orchard from MVConf.  I setup a virtual directory, /orchard, and loaded up the site.

I kept receiving 500 errors when going to the site.  There was a whole round of support emails around figuring out where the errors where steaming from.  Once I found out I learned about the IIS7 inheritance.

For starters I want to list the ways I found to disable the inheritance and then move on to how this could be useful.  (Man it’s always something)

First was the instructions from the Arvixe staff (which I think they found on SO)

<location path="." inheritInChildApplications="false">     <system.web>      ...     </system.web> </location> 

There is also three examples in the IIS.NET bog: http://blogs.iis.net/steveschofield/archive/2009/09/19/control-web-config-inheritance-with-iis-7-asp-net-options.aspx

  1. You can set the enableConfigurationOverride attribute to false for an application pool
  2. allowSubDirConfig=false (as above)
    http://msdn.microsoft.com/en-us/library/ms689469.aspx
  3. inhertInChildApplications property

I haven’t tried all of these yet.  If you have leave a comment on how it well worked. It seems this functionality is enabled when the AppPool is set Integrated mode.

I just read one suggestion to use <clear /> what was inherited in certain sections.

Now for some reasoning on why this functionality was added

For now I just have this link from ASP.NET MSDN library.  It starts out with:

“You can distribute ASP.NET configuration files throughout your application directories to configure ASP.NET applications in an inheritance hierarchy. This structure allows you to achieve the level of configuration detail that your applications require at the appropriate directory levels without affecting configuration settings at higher directory levels.”

I have some reading to do…

Update (8/14/2011):
Reading an informative article on iis.net, Understanding Sites, Applications, and Virtual Directories on IIS 7

The only problem I have with the article is that there absolutely no details on any of the information provided.  Yet it’s a good overview of what they have done in the new version.

Now here are the details I have been looking for: http://learn.iis.net/page.aspx/243/aspnet-integration-with-iis-7/

 

IIS7 Configuration Reference on IIS.NET

 

Reading on…